|
| 27 Mar 2017 05:29 PM |
So I got like this weird radio thing that has a song playing on default, and then when it's done it plays a static sound. The thing is, after the static plays after the certain amount of time, the script pretty much restarts it's stuff and after the amount of time passes again it plays the sound again overlapping with the other one. Pretty much, it's loud as hell, so I tried to make the script remove it's self after a certain amount of time. Since I'm typing here, you already know it didn't work. Any help?
sound = script.Parent.Sound
while true do wait(161) sound:Play() end
while true do wait(162) script:remove() end
I am ready to get roasted by literal script kitties. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 27 Mar 2017 05:34 PM |
all remove does is
self.Parent = nil for _, child in ipairs( self:getChildren() ) do child:remove() end |
|
|
| Report Abuse |
|
|
pspshade
|
  |
| Joined: 29 Apr 2012 |
| Total Posts: 2162 |
|
|
| 27 Mar 2017 05:34 PM |
you didnt specify what "script" is
There once was a boy named Harry, destined to be a star. His parents were killed by Voldemort, who gave him a lightning scar. |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2017 05:34 PM |
| destroy gets rid of connections, stops the things inside, and locks the parent |
|
|
| Report Abuse |
|
|
| |
|
|
| 27 Mar 2017 05:38 PM |
| From my knowledge it's not required to specify it, since if you look at, for example, "script.Parent", it just seems to know you're talking about the parent of the script you're typing, so I assume it would work without the .Parent. I may be wrong.. |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2017 05:39 PM |
| no hes just dumb script is a global variable in roblox representing the script object containing the code |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2017 05:39 PM |
| wait I do have to specify it, thanks! |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2017 05:41 PM |
| Well it didn't work, so it's worth a try, I guess |
|
|
| Report Abuse |
|
|