I have been trying to make a car respawn that takes out money when you click it. I grouped the car with a brick. In the brick I put the following script, and a ClickDetector. What am I doing wrong. PS. Thanks to those who tried helping before on this!
location = script.Parent.Parent.Parent regen = script.Parent.Parent save = regen:clone() function onClicked(hit) if hit.Parent.Humanoid~= nil then local player = game.Players:GetPlayerFromCharacter(hit.Parent) cash = player:WaitForChild("leaderstats").Cash if cash.Value >= 100 then cash.Value = cash.Value - 100 back = save:clone() wait(1) back.Parent = location back:MakeJoints() else print("Not enough Cash") -- Just tells you that they don't have enough Cash end end end script.Parent.Touched:connect(onClicked)