I'll make this short. I have a puzzle area where you click on the part (what I'm talking about), it moves to Lighting, Changes the CameraSubject from a localscript cloning, and clones a keypress script into PlayerGui. CODE:
script.Parent.ClickDetector.MouseHoverEnter:Connect(function(Clicker) if script.Parent:FindFirstChild("SelectionBox") then print("googoo") else local selection = Instance.new("SelectionBox") selection.Color3 = Color3.new(153, 153, 153) selection.LineThickness = 0.03 selection.Parent = Clicker.PlayerGui selection.Adornee = script.Parent end end) script.Parent.ClickDetector.MouseHoverLeave:Connect(function(Clicker) if Clicker.PlayerGui:FindFirstChild("SelectionBox") then Clicker.PlayerGui.SelectionBox:Destroy() end end) --SelectionBox Code Above (might be irrelevant) local Ready = true script.Parent.ClickDetector.MouseClick:Connect(function(plr) if Ready == true then Ready = false local keypress = script.Parent.KeyPressing:Clone() keypress.Parent = plr.PlayerGui keypress.Disabled = false local cloneme = script.Parent.LocalScript:Clone() cloneme.Parent = plr.PlayerGui cloneme.Disabled = false local pieces = game:GetService("ReplicatedStorage").PuzzleKitchenStuff:Clone() pieces.Parent = game.Workspace pieces.Script.Disabled = false if plr.PlayerGui:FindFirstChild("SelectionBox") then plr.PlayerGui.SelectionBox:Destroy() end script.Parent.Parent = game.Lighting Ready = true end end)
So everything works fine until I press the key. Everything within the key functions as told, but the part just doesn't work when it goes back into Workspace..
CODE FOR KEYPRESS:
local camera = game.Workspace.CurrentCamera local player = game.Players.LocalPlayer local mouse = player:GetMouse() game:GetService("UserInputService").InputBegan:Connect(function(inputObject,gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.Q then camera.CameraSubject = player.Character.Humanoid game.Lighting.KitchenPuzzleBruh.Parent = game.Workspace if player.PlayerGui:FindFirstChild("SelectionBox") then player.PlayerGui.SelectionBox:Destroy() end script:Destroy() end end)
So I figured out why it isn't working. Basically for whatever reason the localscript is executing its correct function. Whatever script in workspace that is called by this localscript, does not work.