Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Save Player Position Script Donot Work?

Asked by 6 years ago
Edited 6 years ago

Hello im making a game with tons of adventures and quest. I have everything i need but for some reason the save position script does not work.The script is supposed to say that is saves their position and if they rejoin game theyll be at the position they was at last.

--[[The script is supposed to say that is saves their position and if they rejoin game theyll be at the position they was at last.]]

local DataStore = game:GetService("DataStoreService"):GetDataStore("test")

game.Players.PlayerAdded:connect(function(plr)

if lastPos=nil then
    local lastPos = char.HumanoidRootPart.Position
         while true do 
         wait(1)
     DataStore:SetAsync("last",tostring(lastPos))
          end
else
game.Players.LocalPlayer.Character:MoveTo(lastPos)
end)

PLEASE HELP!

0
http://robloxdev.com/articles/Saving-Player-Data This script needs a lot of work INOOBE_YT 387 — 6y
0
dude ik about saving player data,its just when i try to do it with saving positions,it gets a little messy. Thats why i asked the question. And that link is just a review bc im not a noob Danielp533 16 — 6y
0
You need to align your script, this looks like something Gordon Ramsey would of yelled at if he knew Lua instead of cooking food. seith14 206 — 6y
0
so nobody can help me? Danielp533 16 — 6y
0
I have edited the answer. User#19524 175 — 6y

Answer this question