I am trying to make a car crashing game. I want to make it so that when you crash or destroy your car you get money. How do I do that? Play here
I could give a direction but not a script, you could make a script that checks if every weld exist on every parts, and when a part loses a weld that means money.
Ok I’ll figure out how unless you know but thank you.
make a car made with WeldConstraint | Roblox Creator Documentation
then make a part with a .Touched event that checks if the part has a weld, if has a weld then destroy the weld and the car might look more crashed
local a = script.Parent --part
a.Touched:Connect(function(h)
if h.Parent:FindFirstChildOfClass("Humanoid") == nil then
if h.Parent:FindFirstChildOfClass("WeldConstraint") then
--lets go morbius!
h.Parent:FindFirstChildOfClass("WeldConstraint"):Destroy()
print(h.Name) --what we just destroyed
end
else
return
end
end)
1 Like
I found a script that might help but I’m not sure how to convert it to ROBLOX LUA
function onTouched(hit)
if hit.Parent:findFirstChild(“Humanoid”) then
hit.Parent.Humanoid.MaxHealth = 0
end
end
script.Parent.Touched:connect(onTouched)