So i'm making a checkpoint based game, and I'm making a GUi when they touch a checkpoint, it comes up. But It doesnt, and thats because I'm not getting into the player's GUI. I've tried to access it to make the GUi visible, but I don't know how because all the players will have different names.
s = game.Workspace.Level1.SL2
--[[if s.Enabled == true then
s.Enabled = false
end--]]
s.Enabled = false
function onTouch() --yes I know, i'm to lazy to convert it to an anonymous function.
local b = game.Workspace.Level1:FindFirstChild("SL1")
if b ~= nil then
b.Enabled = false
s.Enabled = true
print("Player has hit a checkpoint!")
local Checkpoint = game.Players:GetChildren()
local a = GetChildren():FindFirstChild("PlayerGui")
if a == true then PlayerGui.Checkpoint.CheckpointBlue.Background then
a.Visible = true
end
end
end
script.Parent.Touched:connect(onTouch)
Thanks!
edit1: Only 1 person will be in the game in the final version

2 comments
Is that the whole script? Or will I need to add my script in it? Sorry for late response
nvm, It works. Thanks!