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

Making a LvL only door, output shows "LocalPlayers is not a valid member of Players". How do i fix? [closed]

Asked by 5 years ago

****full script in the door part:

1script.Parent.Touched:Connect(function()
2    if game.Players.LocalPlayers.leaderstats.Level >= 2 then
3        script.Parent.CanCollide = false
4    end
5end)

line 2 is the problem

Don't know if this is important, but this is the leaderstats script in serverscriptservice

01local level = 1
02local exp = 0
03local axp = 20
04 
05local InStudio = game:GetService("RunService"):IsStudio()
06 
07if not InStudio then
08    level = game:GetService("DataStoreService"):GetDataStore("Levels")
09    exp = game:GetService("DataStoreService"):GetDataStore("EXP")
10    axp = game:GetService("DataStoreService"):GetDataStore("AXP")
11end
12 
13function savedata(dataname, playerid, value)
14    if InStudio then return end
15    dataname:SetAsync(playerid, value)
View all 68 lines...
0
Locking question as error was caused due to a simple typographical error. LocalPlayer... User#24403 69 — 5y

Locked by User#24403

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?