https://gyazo.com/c868fe5722917c1c6cef3c335da43b50 https://gyazo.com/9cad2185947b4ce68d07aef6ba8f66f1 http://prntscr.com/mmuopt https://gyazo.com/03419319048d4ecb74d4d7a82b8eb3f5
When walking up to the stage1 brick it does nothing. It doesn't show the gui and make it visible please help. There is an error on line 5. Please Help.
script.Parent.Touched:Connect(function() local player = game.Players.LocalPlayer if player.leaderstats.Stage.Value <= 0 then player.PlayerGui.stage.stage1.Visible = true elseif player.leaderstats.Stage.Value >= 0 then game.Workspace.stage1door:Destroy() end end)
Please make sure that this is located inside of a LocalScript!
I'm assuming you know how to define a part from inside of the workspace. So make a localscript inside of StarterPlayer > StarterPlayerScripts
Inside of this script you can put the following code, Where it says "PARTNAME" on line one, put your part.
local Part = game:GetService("Workspace"):FindFirstChild("PARTNAME") Part.Touched:Connect(function() local player = game.Players.LocalPlayer if player.leaderstats.Stage.Value <= 0 then player.PlayerGui.stage.stage1.Visible = true elseif player.leaderstats.Stage.Value >= 0 then game.Workspace.stage1door:Destroy() end end)
If this helped you then please mark it as the solution!
Why is this not answered! Someone already said it must be a local script to find a localplayer!