I have a script that clones a part into the CurrentCamera of the player, then when the push a button it destroys the part. I have it like this so it only deletes the part for 1 person, not the whole server. The script looks like this and is inside of a localscript in the StarterGui tab
game.ReplicatedStorage:WaitForChild("Door"):Clone().Parent = workspace.CurrentCamera
local button = workspace.Rooms.VeryEasy.Room2.GreenButton1
-- Create a ClickDetector
local ClickDetector = Instance.new("ClickDetector")
ClickDetector.Parent = button
ClickDetector.MaxActivationDistance = 10
-- Open the button on left mouse click
ClickDetector.MouseClick:Connect(function()
print("work3")
workspace.CurrentCamera.Door:Destroy()
end)
It creates and destroys the part in Roblox Studio, but it doesn't do the same in the actual game. If anyone needs more info on what I want it to do, its on the second green stage in this game https://www.roblox.com/games/4989653371/Tower-Escape-Pre-Alpha-UPDATE?refPageId=fb5fb20e-4f2a-4cbf-9511-07f4a7127df0 (it takes literally under 30 seconds to get there)
