How do you access a player's "leaderstats" in a normal script, if it is possible?
game.Players.PlayerAdded:Connect(function(player)
local leaderboard = Instance.new("Folder")
leaderboard.Name = "leaderstats"
leaderboard.Parent = player
local score = Instance.new("IntValue")
score.Name = "Cash"
score.Parent = leaderboard
score.Value = 100
end)
Like for a touch event, I want to increase the player's "Cash" when they touched the part.
local door = script.Parent
local player = game.Players.LocalPlayer
local cash = player:WaitForChild("leaderstats").Cash
door.Touched:Connect(function()
cash.Value = cash.Value +100
end)

3 comments
Remote events
Can you elaborate on that more?
stop using local variables outside of their scope