What I mean is, I have a script in a part. When I click the part, A noise is supposed to play, and then a ball is to be created at the given vector. It also checks if an "IntValue" is atleast 5 and then subtracts 5. But nothing works, and no error is in the output. Here's the script:
local part = script.Parent
local db = false
function gum(hit)
local human = hit.Parent
local character = game.Players:GetPlayerFromCharacter(hit.Parent)
if character then
if not db then
db = true
if character.leaderstats.Money.Value >= 5 then
character.leaderstats.Money.Value = character.leaderstats.Money.Value - 5
part.Sound:Play()
wait(2)
local ball = game.Lighting.ball
ball:Clone().Parent = game.Workspace
ball.Position = Vector3.new(31,12,-6)
ball.Anchored = false
db = false
else
print("You need more money!")
end
end
end
end
part.ClickDetector.MouseClick:connect(gum)
All help is appreciated!

2 comments
Ok, this worked, but one last question. So, I don't need to define character in Click events? The parameter does it for me? But in Touch events I do, am I correct?
In Clicked events, there is no specific parts clicking the part. Just player interaction. With touched events, there is a part hitting another part. So you would have to go through the character through that.