generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Is it possible to put 2 different scripts into 1?

Previous Thread :: Next Thread 
Senpais_Notice is not online. Senpais_Notice
Joined: 13 Oct 2012
Total Posts: 740
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 is not online. 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
LegomasterNiko is not online. LegomasterNiko
Joined: 27 Feb 2013
Total Posts: 1176
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
sorathedarkness is not online. sorathedarkness
Joined: 29 Nov 2010
Total Posts: 142
22 Oct 2017 09:24 PM
Put them in the same RemoteFunction?
Report Abuse
Senpais_Notice is not online. Senpais_Notice
Joined: 13 Oct 2012
Total Posts: 740
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 is not online. kylerzong
Joined: 06 Aug 2011
Total Posts: 659
22 Oct 2017 10:20 PM
coroutines
Report Abuse
soutenu is online. 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
Senpais_Notice is not online. Senpais_Notice
Joined: 13 Oct 2012
Total Posts: 740
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
Senpais_Notice is not online. Senpais_Notice
Joined: 13 Oct 2012
Total Posts: 740
22 Oct 2017 10:24 PM
Sorry roblox sucks. Wont let me post the script.




Report Abuse
kylerzong is not online. 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 is not online. 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
Senpais_Notice is not online. Senpais_Notice
Joined: 13 Oct 2012
Total Posts: 740
22 Oct 2017 10:28 PM
Is there anything useful in those hashtags? :|


Report Abuse
Senpais_Notice is not online. Senpais_Notice
Joined: 13 Oct 2012
Total Posts: 740
22 Oct 2017 10:31 PM
Didn't work.


Report Abuse
MICHEAL1988351 is online. MICHEAL1988351
Joined: 26 Jan 2015
Total Posts: 582
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
Realizationz is not online. Realizationz
Joined: 01 May 2008
Total Posts: 311
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 is not online. kylerzong
Joined: 06 Aug 2011
Total Posts: 659
22 Oct 2017 10:35 PM
paystebin com/1ZBGgbNP
Report Abuse
kylerzong is not online. kylerzong
Joined: 06 Aug 2011
Total Posts: 659
22 Oct 2017 10:36 PM
cause I felt like using coroutines nerd
Report Abuse
Realizationz is not online. Realizationz
Joined: 01 May 2008
Total Posts: 311
22 Oct 2017 10:38 PM
lol only nerds use coroutines so takes one to know one.
Report Abuse
LegomasterNiko is not online. LegomasterNiko
Joined: 27 Feb 2013
Total Posts: 1176
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
Senpais_Notice is not online. Senpais_Notice
Joined: 13 Oct 2012
Total Posts: 740
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 is not online. kylerzong
Joined: 06 Aug 2011
Total Posts: 659
22 Oct 2017 10:40 PM
coroutines are the best ya spetnaz
Report Abuse
kylerzong is not online. kylerzong
Joined: 06 Aug 2011
Total Posts: 659
22 Oct 2017 10:41 PM
the paystebin works you tw/\ht
Report Abuse
SurKipper is not online. 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 is online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image