Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

leaderstats is not a valid member of RBXScriptSignal?

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)

2 comments

0

Are you sure this is the correct code?

0

Is this the entire script? If not, please show everything so that we can debug correctly.

1 answer

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

2 comments

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

0

RBXScriptSignal basically means, an Instance. So in his case he is trying to index an instance with leaderstats.

This discussion is preserved as it was. New answers, comments, and votes are closed.