Hi I am new to this platform.
I am having an issue with .Touched events. Specifically reading an IntValue.
The script is server-side and is in game.Workspace.sell_shop.Sell.Part and the script gets player data from the players leaderstats (Clicks, Money and Rebirths).
This is the current code I have so far:
local part = script.Parent
local players = game:GetService("Players")
part.Touched:Connect(function(otherPart)
if otherPart.Parent:FindFirstChild("Humanoid") then
local player = players:GetPlayerFromCharacter(otherPart.Parent)
local clicks = player.leaderstats.Clicks.Value
print(clicks) -- Prints 0
end
end)
Localscripts can read these leaderstats and scripts in ServerScriptService can get leaderstats

2 comments
I will give it a try but I'm not accessing LocalPlayer though?
I have tried it and it is still saying all stats are 0 even from a remote event and local script