#Sell system
1 messages · Page 1 of 1 (latest)
local part = script.Parent
part.Touched:Connect(function(touch)
local plr = game.Players:GetPlayerFromCharacter(touch.Parent)
local leaderstats = plr:FindFirstChild("leaderstats")
if leaderstats then
local coins = leaderstats:FindFirstChild("Coins")
local clicks = leaderstats:FindFirstChild("Clicks")
print(clicks.Value)
end
end)
why computer cant read the clicks value ?
Does it throw any error in the output?
nope
can u come #1006356488912121967 bec there is 1 communicate with me so i dont change room every time
@drowsy frigate so u know how to fix it ?
Are you sure the touched function working?
yes it prints number 0
when i touch block
Alr then one minute
ok
same
do you change clicks value on server or client
cuz if you do Clicks.Value = 200 on client (for example), on server it won't change (and for server it will be 0)
yess this happen
like in clint its 7 clicks but on server its 0
what is even that ?!??! the only remote i know is tv
in this case u wanna do (ofc this is just an example)
on client
button.Activated:Connect(function()
RemoteEvent:FireServer(increment_value)
end
on server
RemoteEvent.OnServerEvent:Connect(function(Player, incrementValue) -- first argument is ALWAYS a Player
local leaderstats = ...
local Clicks = leaderstats.Clicks
Clicks.Value += incrementValue
end)