Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Currency Exchanging on touch will not work?

I have a script to where it's supposed to take ores and turn them into Credits. It doesn't wanna work, and I'm quite confused as to why. Can anyone help me?

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.Credits
	local Selling = leaderstats.Ores
		if Selling.Value > 0 then
			Currency.Value = Currency.Value + Selling.Value *5 -- This 1 means multiple you can change it to whatever you want
			Selling.Value = 0
		end
end
end
end)

2 comments

0

I tested this and it seems to work, it may be another script interfering.

0

it also didnt work for me

1 answer

It works now. Still no idea what the initial problem was I've changed nothing

This discussion is preserved as it was. New answers, comments, and votes are closed.