Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do i make a function fire on parts collided?

Asked by
n_ubo 29
5 years ago
01local part = script.Parent
02 
03part.Touched:Connect(function()
04    script.Parent.Sound1:Play() --play drop sound
05workspace.AirDrop.Dropdown.Disabled = false --launch
06workspace.AirDrop.Transparency = 0 --reveal airdrop
07wait(18)
08workspace.AirDrop.Dropdown.Disabled = true --reset down fall script for next one
09 
10 
11end)

line 3 doesn't fire! i am trying to make an airdrop drop when the plane touches it. the airdrop and the plane are both unions. m8 that be the problem? else if so, what do i need to do?

0
What does: Workspace.AirDrop.Dropdown.Disabled = false do? 123nabilben123 499 — 5y
0
If the two parts that are supposed to fire are anchored, then that may be the problem. If not that, no idea. hoyhyo 2 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

I think this might work but i'm not sure

01local part = script.Parent
02 
03part.Touched:Connect(function(hit)
04    if hit.Name == "Part" then -----Whatever the name of the part is
05    script.Parent.Sound1:Play()
06workspace.AirDrop.Dropdown.Disabled = false
07workspace.AirDrop.Transparency = 0
08wait(18)
09workspace.AirDrop.Dropdown.Disabled = true
10 
11 
12end)
Ad

Answer this question