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

Why is leaderstats not a valid member of Player?

Asked by 4 years ago

local ReplicatedStorage = game:GetService("ReplicatedStorage") local RemoteEvents = ReplicatedStorage.RemoteEvents

local GivePoint = RemoteEvents.GivePoint

GivePoint.OnServerEvent:Connect(function(player) local points = player.leaderstats.Points local ClickBonus = player.Playerstats.ClickBonus points.Value = points.Value + (1 + ClickBonus.Value) end)

0
and i have leaderstats already xTheodxre 16 — 4y

1 answer

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

Try this:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvents = ReplicatedStorage.RemoteEvents

local GivePoint = RemoteEvents.GivePoint

GivePoint.OnServerEvent:Connect(function(player) 
    local points = player:WaitForChild("leaderstats").Points
    local ClickBonus = player:WaitForChild("Playerstats").ClickBonus 
    points.Value = points.Value + (1 + ClickBonus.Value) 
    end)
0
tysm!! is worked xTheodxre 16 — 4y
0
no problem :D itz_rennox 412 — 4y
Ad

Answer this question