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

leaderstats is not a valid member of RBXScriptSignal? [closed]

Asked by 4 years ago

when I join the game Im getting a error saying my leaderstats isnt a valid member of RBXScriptSignal does anyone know how to fix this? this script is meant to give a player 1 level every 30 seconds .


game.Players.PlayerAdded:Connect(function(plr) local Level = plr.leaderstats.Level while true do Level.Value = Level.Value + 1 wait(30) end end)
0
Are you sure this is the correct code? Amiaa16 3227 — 4y
0
Is this the entire script? If not, please show everything so that we can debug correctly. brokenVectors 525 — 4y

Closed as Too Broad by brokenVectors, IAmNotTheReal_MePipe, and JesseSong

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 4 years ago

Try this script for your leaderstats

game.Players.PlayerAdded:Connect(function(plr)
    local stats = Instance.new("Folder")
    stats.Name = "leaderstats"
    stats.Parent = plr

    local level = Instance.new("IntValue", stats)
    level.Name = "Level"
end)

and the script you put on here works

0
i don't think this would fix it, since he's trying to index leaderstats from an RBXScriptSignal, so he probably added a weird thing in his code that messes everything up brokenVectors 525 — 4y
0
RBXScriptSignal basically means, an Instance. So in his case he is trying to index an instance with leaderstats. JesseSong 3916 — 4y
Ad