hey everyone, im making a simulator game, but when i click it says the local i made is a nil value:
game.Players.PlayerAdded:Connect(function(player)
print("leaderstats")
local leaderstats = Instance.new('IntValue', player)
leaderstats.Name = 'leaderstats'
print("leaderstats")
local IQ = Instance.new("IntValue", leaderstats)
IQ.Name = "IQ"
IQ.Value = 1000
end)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
-- local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Toolnumber1clickEvent = Instance.new("RemoteEvent", ReplicatedStorage)
Toolnumber1clickEvent.Name = "Toolnumber1clickEvent"
local function onToolnumber1clickEventFired(player, number)
IQ.Value = IQ.Value + 1
end
Toolnumber1clickEvent.OnServerEvent:Connect(onToolnumber1clickEventFired)
do you know why it says its a nil value? please tell me :)

1 comment
oh ok thank you so much :D you just made a nice game possible for roblox :)