Error: Workspace.Leaderboard:22: Expected ')' (to close '(' at line 13), got 'end'
Code:
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
local Leaderstats = Instance.new("Folder")
Leaderstats.Name = "leaderstats"
Leaderstats.Parent = Player
local Stage = Instance.new("IntValue")
Stage.Name = "Stage"
Stage.Value = 0
local function SaveCurrentStage(ply)
Stage.Value = StageDataStore:SetAsync(tostring(ply.UserId), ply.leaderstats.Stage.Value)
Stage.Value = 0
Stage.Parent = Leaderstats
Player.CharacterAdded:Connect(function(Characer)
local Leaderstats = Player:FindFirstChild("leaderstats")
if (Leaderstats and Leaderstats.Stage) then
local Stage = workspace:FindFirstChild(tostring(Stage.Value))
if (Stage) then
Player.Character:MoveTo(Stage.Position + Vector3.new(0,3,0))
end
end
end
end
Thanks.

3 comments
Well, I suppose you have the code to trigger your SaveCurrentStage function
weird, I could not see the answer. Sorry, I'm new here :). I thought in a bit for what this LUA button is doing, just pasted the code in the wrong place.
Thank you so much. It works without any error ????????????????????????