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

Why is leaderstats not a valid member of Player?

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)

1 comment

0

and i have leaderstats already

1 answer

✓ Accepted answer

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)

2 comments

0

tysm!! is worked

0

no problem :D

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