So I'm trying to create a position saving/loading script but I keep running into errors
If I make the script like this:
game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
p.Character:moveTo(p:WaitForChild('leaderstats'):WaitForChild('LastLocation').Value)
print('locationloaded')
end)
p.CharacterAdded:connect(function(c)
repeat
wait(0.5)
p.leaderstats.LastLocation.Value = p.Character.HumanoidRootPart.Position
print('locationsaved')
until 1 == 0
end
I get the following error:
ServerScriptService.AutosavingLocation.PlayerJoined/PlayerLeft:12: ')' expected (to close '(' at line 6) near '<eof>'
Else if I add a ")" the end
game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
p.Character:moveTo(p:WaitForChild('leaderstats'):WaitForChild('LastLocation').Value)
print('locationloaded')
end)
p.CharacterAdded:connect(function(c)
repeat
wait(0.5)
p.leaderstats.LastLocation.Value = p.Character.HumanoidRootPart.Position
print('locationsaved')
until 1 == 0
end)
I get the following error:
ServerScriptService.AutosavingLocation.PlayerJoined/PlayerLeft:12: 'end' expected (to close 'function' at line 1) near '<eof>'

2 comments
You got three functions. You gotta close all of em' eventually. That's why you need two end) at the end. I'll rewrite the script so it'll be easier to see. :D
nvm someone already did.