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

Why is it underlining my player variable?

Asked by 5 years ago
01local ds = game:GetService("DataStoreService")
02local ds1 = ds:GetDataStore("PostionSavingSystem")
03 
04game.Players.PlayerAdded:Connect(function(players)
05 local val = Instance.new("Vector3Value", players)
06 val.Name = "Position"
07 
08 local userdata
09 pcall(function()
10  userdata = ds1:GetAsync(player.UserId)
11 
12 end)
13 if userdata then
14 game.Workspace:WaitForChild(player.Name):WaitForChild("HumanoidRootPart").CFrame = CFrame.new(userdata.x, userdata.y, userdata.z)
15 else
View all 30 lines...

the game is saying underlining only player, its also saying SetAysnc is not a valid member of GlobalDataStore but it is???

0
GlobalDataStore:SetAsync(); Not GlobalDataStore:SetAysnc() improper spelling. Its depreciated voidofdeathfire 148 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Like @voidofdeathfire said; you misspelled SetAsync(). But you also put a comma at the end of your table which ruined your script.

01local ds = game:GetService("DataStoreService")
02local ds1 = ds:GetDataStore("PostionSavingSystem")
03 
04game.Players.PlayerAdded:Connect(function(players)
05 local val = Instance.new("Vector3Value", players)
06 val.Name = "Position"
07 
08 local userdata
09 pcall(function()
10  userdata = ds1:GetAsync(player.UserId)
11 
12 end)
13 if userdata then
14 game.Workspace:WaitForChild(player.Name):WaitForChild("HumanoidRootPart").CFrame = CFrame.new(userdata.x, userdata.y, userdata.z)
15 else
View all 30 lines...
Ad

Answer this question