local Part = script.Parent
Part.Touched:Connect(function(HIT)
local H = HIT.Parent:FindFirstChild("Humanoid")
if H then
local player = game.Players:GetPlayerFromCharacter(HIT.Parent)
if player then
local leaderstats = player:WaitForChild("leaderstats")
local Currency = leaderstats.Money
local Selling = leaderstats.Backpack
if Selling.Value > 0 then
Currency.Value = Currency.Value + Selling.Value *1
Selling.Value = 0
end
end
end
end)
COMMUNITY QUESTION
My SELL is not working also if i debug it with Print() nothing printing on the console?
2 answers
change line 5 to this
local player = game.Players:WaitForChild(HIT.Parent)
8 comments
0
Still not working
0
maybe change HIT to hit?
0
Still not Working :<
0
can you post what your output is saying
0
it should be a server sided script (the blue one)
0
check line 9
0
So i will add RemoteEvent?
0
if its a local script then just copy the code from the local script into a server script, put the server script in the same place the local script was, then delete the local script
Try a debounce system https://developer.roblox.com/en-us/articles/Debounce
--Code by roblox
function debounce(func)
local isRunning = false -- Create a local debounce variable
return function(...) -- Return a new function
if not isRunning then
isRunning = true
func(...) -- Call it with the original arguments
isRunning = false
end
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
is this in a script and not a localscript?