i tried to make this script convert 500 "Money" into 1 "Credits"
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if hit.leaderstats.Money.Value >= 500 then
hit.leaderstats.Money.Value = hit.leaderstats.Money.Value - 500
hit.leaderstats.Credits.Value = hit.leaderstats.Credits.Value + 1
else
print("Not enough money")
end
end
end)
basically i tried to make it find the humanoid then if they had 500 or more money it would give them 1 credit in return, but nothing happened
thanks

4 comments
for some reason it prints not enough money when i have 1000 money?
Are you sure that you change your money value from the server and not the client? (For Filtering enabled)
no, how do you do that?
nvm it works now, i guess it didnt work before because i gave myself money. thanks!