So I was testing out my script and there was some type of a problem joining in the game where the script doesn't load up whenever a player joins a server until they reset for it to work. Although it works sometimes, it doesn't do it always.
game.Players.PlayerAdded:connect(function(player) local currentlevel = player:WaitForChild("leaderstats"):WaitForChild("Level") player.CharacterAdded:connect(function(char) if currentlevel.Value >= 2 then script.Parent.Parent.StarterGui.Stamina.Handler.Disabled = false end if currentlevel.Value >= 3 then script.Parent.Parent.StarterGui.DoubleJump.Disabled = false end if currentlevel.Value >= 4 then player.Backpack.ScriptStorage.PlayerMovement.ForwardDash.Disabled = false end char.Humanoid.Died:connect(function() if currentlevel.Value >= 2 then script.Parent.Parent.StarterGui.Stamina.Handler.Disabled = false end if currentlevel.Value >= 3 then script.Parent.Parent.StarterGui.DoubleJump.Disabled = false end if currentlevel.Value >= 4 then player.Backpack.ScriptStorage.PlayerMovement.ForwardDash.Disabled = false end end) end) end)
You need to use Local Script to access Player Gui's You cannot edit PlayerGui's with StarterGui
You can see PlayerGui in Roblox Wiki > Roblox Wiki Page - PlayerGui
And you can see PlayerGui vs StarterGui in Roblox Wiki > Roblox Wiki Page - Player vs. Starter GUIs
Also you can see StarterGui in Roblox Wiki > Roblox Wiki Page - StarterGui
You can use this:
-- Local Script > put this on GUI -- repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character local player = game.Players.LocalPlayer local char = player.Character local currentlevel = player:WaitForChild("leaderstats"):WaitForChild("Level") function update() if currentlevel.Value >= 2 then script.Parent.Stamina.Handler.Disabled = false end if currentlevel.Value >= 3 then script.Parent.DoubleJump.Disabled = false end if currentlevel.Value >= 4 then player.Backpack.ScriptStorage.PlayerMovement.ForwardDash.Disabled = false end end while true do update() wait(0.5) end
Hope it helped! Good luck into your game!