|
| 22 Oct 2017 09:20 PM |
I wanted to put my kill brick script into my color changing script but it completely disregarded the death script and just made the block change colors. Is there a way to maybe merge the 2 different scripts into 1 to save space?
https://www.roblox.com/library/916512509/Meet-me-in-the-Swamp-Skrillshrex |
|
|
| Report Abuse |
|
|
legoch12
|
  |
| Joined: 08 Feb 2008 |
| Total Posts: 25 |
|
|
| 22 Oct 2017 09:21 PM |
So do you want the script to kill the player and change the brick colour at the same time?
|
|
|
| Report Abuse |
|
|
|
| 22 Oct 2017 09:23 PM |
I think it is possible. did you try adding an end function at the end of the color than placing the other in? |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2017 09:24 PM |
| Put them in the same RemoteFunction? |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2017 10:12 PM |
Yes I want it to do both at the same time. Should I put 2 ends after the brick color one then put the kill brick in?
https://www.roblox.com/library/916512509/Meet-me-in-the-Swamp-Skrillshrex |
|
|
| Report Abuse |
|
|
kylerzong
|
  |
| Joined: 06 Aug 2011 |
| Total Posts: 659 |
|
| |
|
soutenu
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 1021 |
|
|
| 22 Oct 2017 10:21 PM |
| ^that's not the answer @OP of course you can put code in the same script |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2017 10:23 PM |
| Well how can I do it? this is my script atm. while true do script.Parent.BrickColor = BrickColor.Random() wait(0.5) script.Parent.BrickColor = BrickColor.Random() ######### ### ########################################### hit.Parent.Humanoid.Health = 0 end) https://www.roblox.com/library/916512509/Meet-me-in-the-Swamp-Skrillshrex |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2017 10:24 PM |
Sorry roblox sucks. Wont let me post the script.
|
|
|
| Report Abuse |
|
|
kylerzong
|
  |
| Joined: 06 Aug 2011 |
| Total Posts: 659 |
|
|
| 22 Oct 2017 10:26 PM |
| local ######### # ########################### while true do wait() script.Parent.Color = Color3.fromRGB(math.random(1,255),math.random(1,255),math.random(1,255) end end) coroutine.resume(newThread) script.Parent.Touched:connect(function(h) player = game.Players:GetPlayerFromCharacter(h.Parent) if player then pcall(function() player.Humanoid.Health = 0 end) end end |
|
|
| Report Abuse |
|
|
kylerzong
|
  |
| Joined: 06 Aug 2011 |
| Total Posts: 659 |
|
|
| 22 Oct 2017 10:27 PM |
| l o c a l n e w T h r e a d = c o r o u t I n e . c r e a t e ( f u n c t i o n ( ) |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2017 10:28 PM |
Is there anything useful in those hashtags? :|
|
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Oct 2017 10:32 PM |
--kill thread spawn(function() ... end)
--color thread spawn(function() ... end)
--both in one script. Is this not what you want? |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2017 10:34 PM |
| why would you coroutine something this basic? lol look what Micheal put, it's as simple as that. |
|
|
| Report Abuse |
|
|
kylerzong
|
  |
| Joined: 06 Aug 2011 |
| Total Posts: 659 |
|
| |
|
kylerzong
|
  |
| Joined: 06 Aug 2011 |
| Total Posts: 659 |
|
|
| 22 Oct 2017 10:36 PM |
| cause I felt like using coroutines nerd |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2017 10:38 PM |
| lol only nerds use coroutines so takes one to know one. |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2017 10:40 PM |
| If you want to show the scripts, Just copy both scripts past them in a SurfaceGui Text than, open the place so we can see |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2017 10:40 PM |
@Michael do I need to include the "..." each time? also what is the spawn(function()? Is it just a example/placeholder?
|
|
|
| Report Abuse |
|
|
kylerzong
|
  |
| Joined: 06 Aug 2011 |
| Total Posts: 659 |
|
|
| 22 Oct 2017 10:40 PM |
| coroutines are the best ya spetnaz |
|
|
| Report Abuse |
|
|
kylerzong
|
  |
| Joined: 06 Aug 2011 |
| Total Posts: 659 |
|
|
| 22 Oct 2017 10:41 PM |
| the paystebin works you tw/\ht |
|
|
| Report Abuse |
|
|
SurKipper
|
  |
| Joined: 25 Dec 2011 |
| Total Posts: 435 |
|
|
| 22 Oct 2017 11:39 PM |
guys guys guys guys guys
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild('Humanoid') then hit.Parent.Humanoid.Health = 0 end end)
while wait(1) do script.Parent.BrickColor = BrickColor.Random() end |
|
|
| Report Abuse |
|
|
soutenu
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 1021 |
|
|
| 23 Oct 2017 01:47 PM |
| @Su that's what ive been trying to say |
|
|
| Report Abuse |
|
|