RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a script that turns a part invisible when i press e and tell me how to set it up"
-- local script local UserInputService = game:GetService("UserInputService") local part = game.Workspace.Part -- replace 'Part' with the name of your part local function handleKeyPress(input) if input.KeyCode == Enum.KeyCode.E then if part.Transparency == 0 then part.Transparency = 1 else part.Transparency = 0 end end end UserInputService.InputBegan:Connect(handleKeyPress) -- To set this up in Roblox, follow these steps: 1. Open Roblox Studio and go to the Workspace. 2. Find the part you want to make invisible and visible. 3. Right click on the part and click on 'PrimaryPart'. 4. Create a new script in the part. 5. Copy and paste the above script into the new script. 6. Replace 'Part' in the script with the name of your part. 7. Press the 'Play' button to test the script. 8. Press 'E' to make the part invisible and visible.