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

What do I do with these funtions?

Asked by 10 years ago

Well I am working on a celebration script that shoots fire out of the goal when someone makes the shot. I'm not sure how to do it though, I got the script to make the flame and the size i want it but it makes it as soon as the game starts up.

Here's what I got.

It requires four scripts with it so I will put e'm up for you.

name = "pass/shoot" 
debounce = false 

msg = Instance.new("Message") 
msg.Text = "Swish" 
flm = Instance.new("Fire", game.Workspace.Tube.flame1)
flm.Size = 10
flm.Heat = 25 

function onTouched(hit) 

if (debounce==false) and (hit.Parent.Name==name) then 

debounce = true 

msg.Parent = game.Workspace 
wait(3) 
msg.Parent = nil 
flm.Parent = nil
debounce = false 

end 
end 

script.Parent.Touched:connect(onTouched) 


name = "Bomb" 
debounce = false 

msg = Instance.new("Message") 
msg.Text = "Swish!" 
flm = Instance.new("Fire", game.Workspace.Tube.flame1)
flm.Size = 10
flm.Heat = 25

function onTouched(hit) 

if (debounce==false) and (hit.Parent.Name==name) then 

debounce = true 

msg.Parent = game.Workspace 
wait(4) 
msg.Parent = nil 
flm.Parent = nil
debounce = false 

end 
end 

script.Parent.Touched:connect(onTouched) 


name = "Layup" 
debounce = false 

msg = Instance.new("Message") 
msg.Text = "Swish." 
flm = Instance.new("Fire", game.Workspace.Tube.flame1)
flm.Size = 10
flm.Heat = 25

function onTouched(hit) 

if (debounce==false) and (hit.Parent.Name==name) then 

debounce = true 

msg.Parent = game.Workspace 
wait(3) 
msg.Parent = nil 
flm.Parent = nil
debounce = false 

end 
end 

script.Parent.Touched:connect(onTouched) 


function onTouched(hit)
    script.Parent.Chaching:play()
end
script.Parent.Touched:connect(onTouched)

Any ideas? Thanks. -Bestbudd1

1 answer

Log in to vote
1
Answered by 10 years ago

You need to put the stuff not inside a function into a function. That function would be like your other touch functions, except it would check when the goal object (ball?) touches the goal area. Inside that object you need a value of the players name, if you want to check which player or team made the shot.

0
Thank you very much! got it fixed now. bestbudd1 45 — 10y
Ad

Answer this question