|
| 13 Feb 2017 08:13 AM |
function onTouched(hit) if hit.Parent:findFirstChild('Humanoid') then local player = game.Players:findFirstChild(hit.Parent.Name) if player then local N = script.Parent.Notice:clone() N.Parent = player.PlayerGui N.Frame.TextLabel.Text = "Strange Noises can be heard from within the Cave..." game.Lighting.DialgaCry:Play() wait(1) game.Lighting.PalkiaCry:Play() wait(3) N.Parent = script.Parent else end end end script.Parent.Touched:connect(onTouched)
After it's been touched, I want it so that it can be stepped on after 5 seconds but it won't disable the script.
#code print("Fire Dragon's Roar!!") --yes, i am natsu xd |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 13 Feb 2017 08:14 AM |
| ############################################### |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 13 Feb 2017 08:15 AM |
That was a roblox wiki link, what the heck.
The letter "a" is probably censored above too.
Check out Debounce on the ROBLOX wiki.
wiki.roblox.com/index.php?title=Debounce |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2017 08:20 AM |
| I know how the wait part works but where would it go? I want the code to happen ## soon ## it's stepped on however, I want it to next work again after 5 seconds. #code ########### Dragon's Roar!!") --yes, i am natsu xd |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Feb 2017 08:24 AM |
? so i would change Touched to TouchEnded?
#code print("Fire Dragon's Roar!!") --yes, i am natsu xd |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2017 08:26 AM |
I havent really tried TouchedEnded but im sure you would need that to detect when the player has stopped touching it.
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 13 Feb 2017 08:57 AM |
local palkia = workspace.Sounds.Palkia local dialga = workspace.Sounds.Dialga --dont store anything in lighting local part = script.Parent local notice = part.Notice local debounce = false
part.Touched:connect(function(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if not player or debounce then return end debounce = true local notice = notice:Clone() notice.Parent = player.PlayerGui notice:WaitForChild('Frame').TextLabel.Text = 'Strange Noises can be heard from within the Cave...' dialga:Play() wait(1) palkia:Play() wait(3) notice:Destroy() wait(1) debounce = false end)
|
|
|
| Report Abuse |
|
|