local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvents = ReplicatedStorage.RemoteEvents
local Sold = RemoteEvents.ItemSold
local Debounce = false
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
if Player.Playerstats.CurrentValue.Value >= 0 then
if Debounce == false then
Debounce = true
Sold:FireClient(Player, Player.PlayerStats.CurrentValue.Value)
Player.PlayerStats.Coins.Value = Player.PlayerStats.Coins.Value + Player.PlayerStats.CurrentValue.Value
Player.PlayerStats.CurrentValue.Value = 0
wait()
Debounce = false
end
end
end
end)
thats my script how can i fix it?

4 comments
Is this a server script? Is your PlayerStats created by the client?
Its a script in a brick and yes the player stats exists
Thats not what i asked, you're sending a remote event to the client, for what looks to be no reason?
My playerstats are created by the client