I would like to create an obby and I have a script for the block that when you touch it your leaderstat increases whenever the player touches the brick! It is not working here's the script!
Part = script.Parent name = script.Parent.Name debounce = false plr = game:WaitForChild('Players') ok = plr.LocalPlayer ls = ok.leaderstats.Stage Part.Touched:Connect(function(Hit) if Hit.Parent:FindFirstChild("Humanoid") and game:GetService("Players")[Hit.Parent.Name] then debounce = true ls.Value = ls.Value +1 end end)
Hello, tightanfall!
Part = script.Parent name = script.Parent.Name debounce = false plr = game:WaitForChild('Players') --Removed thease 2 lines, considering this is a Normal Script and it don't have a link to Local Player Part.Touched:Connect(function(Hit) if Hit.Parent:FindFirstChild("Humanoid") and game:GetService("Players")[Hit.Parent.Name] then debounce = true ls = Game.Players:GetPlayerFromCharacter(hit.Parent) -- Gets the player based on the character ls.Value = ls.Value +1 end end)
Good Luck with your games