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 » Scripting Helpers
Home Search
 

Re: I found a new exploit!

Previous Thread :: Next Thread 
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
31 Mar 2012 10:45 PM
Joking. It seems as though nobody replies when I don't post a relevant subject.

I need help with a beginners script, because I'm learning how to script and this seems to not be working. No output.

thing = game.Workspace.Part
function onTouched
wait(0.5)
thing.Color = Color3.new(math.random(1,255), math.random(1,255), math.random(1,255))
wait(60)
thing.Explode
end
while true do
local p = Instance.new ("Hint")
p.Parent = game.Workspace
p.Text = "Slayer219 helped me make this epical place!"
wait(300)
p:Remove()
end
while true do
local thing = Instance.new ("Smoke")
wait (60)
thing:Remove ()


What this is supposed to do is change the color of the part every 0.5 seconds, make an explosion at the position of the brick every 60 seconds, inserts a hint every 5 minutes saying Slayer219 helped me make this epical place! and finally insert smoke on the part every 10 minutes.

I don't exactly have a guess where i messed up, but I would guess at math.random maybe.
Report Abuse
FisherPenguin is not online. FisherPenguin
Joined: 14 Jun 2010
Total Posts: 1157
31 Mar 2012 10:48 PM
function onTouched(hit)
ALSO
script.Parent.Touched:connect(onTouched)

Those are the two obvious mistakes.

+-Fishy
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
31 Mar 2012 10:49 PM
Sorry, as I said i'm new to scripting. Actually, just learned the basics today.
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
31 Mar 2012 10:52 PM
Is that all? Output wasn't helpful at all,but I just noticed that I didn't enter the coordinates with Vector3.new. either...
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
31 Mar 2012 10:57 PM
Bump.
Report Abuse
Phellem is not online. Phellem
Joined: 04 Aug 2011
Total Posts: 1984
31 Mar 2012 11:00 PM
"while true do
local p = Instance.new ("Hint")
p.Parent = game.Workspace
p.Text = "Slayer219 helped me make this epical place!"
wait(300)
p:Remove()
end
while true do
local thing = Instance.new ("Smoke")
wait (60)
thing:Remove ()"


Woah... crazy?

Okay... you forgot to close the second loop.
Plus, the first while true loop will keep repeating. It will not allow the script to go on to the next loop.
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
31 Mar 2012 11:02 PM
So I need to put everything in 1 loop?
Report Abuse
Phellem is not online. Phellem
Joined: 04 Aug 2011
Total Posts: 1984
31 Mar 2012 11:02 PM
Also, I don't think a Part has the property color in it.
Try BrickColor = BrickColor.random()
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
31 Mar 2012 11:03 PM
But i could still use the variable right?

In the first part i made game.Workspace.Part be "thing"
Report Abuse
FisherPenguin is not online. FisherPenguin
Joined: 14 Jun 2010
Total Posts: 1157
31 Mar 2012 11:03 PM
Yes.

+-Fishy
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
31 Mar 2012 11:05 PM
So it would be thing = BrickColor.random?
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
31 Mar 2012 11:12 PM
Bump.
Report Abuse
FisherPenguin is not online. FisherPenguin
Joined: 14 Jun 2010
Total Posts: 1157
31 Mar 2012 11:13 PM
I think...Should be but I've never dealt with randoms.

+-Fishy
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
31 Mar 2012 11:14 PM
Well i'll try that and add the Vector3.new coordinates for the explosion and the smoke.
Report Abuse
Phellem is not online. Phellem
Joined: 04 Aug 2011
Total Posts: 1984
31 Mar 2012 11:23 PM
"What this is supposed to do is change the color of the part every 0.5 seconds, make an explosion at the position of the brick every 60 seconds, inserts a hint every 5 minutes saying Slayer219 helped me make this epical place! and finally insert smoke on the part every 10 minutes."

Umm... do you even need the touched function?

Here is what I coded by looking at what you want:

thing = game.Workspace.Part
function a()
while true do
wait(0.5)
thing.BrickColor = BrickColor.random()
end
end

function b()
while true do
wait(60)
Instance.new("Explosion",workspace).Position=thing.Position
end
end

function c()
while true do
wait(60*5)
local p = Instance.new("Hint",workspace)
p.Text = "Slayer219 helped me make this epical place!"
wait(1)
p:Remove()
end
end

function d()
while true do
wait(60*10)
local thing = Instance.new ("Smoke",thing)
wait(1)
thing:Remove()
end
end

a = coroutine.create(a)
coroutine.resume(a)
b = coroutine.create(b)
coroutine.resume(b)
c = coroutine.create(c)
coroutine.resume(c)
d = coroutine.create(d)
coroutine.resume(d)
Report Abuse
Phellem is not online. Phellem
Joined: 04 Aug 2011
Total Posts: 1984
31 Mar 2012 11:26 PM
Sorry if it is not efficient.
I don't know a shorter way to write it.
Maybe I could put the function in coroutine.create()...
Hmm...

Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
31 Mar 2012 11:27 PM
Alright well now it displayed the hint, but it didn't change the color, explode the Part or make smoke. Heres the updated script:


thing = game.Workspace.Part
function onTouched(hit)
script.Parent.Touched:connect(onTouched)
wait(0.5)
thing.Color = BrickColor.new(math.random(1,255), math.random(1,255), math.random(1,255))
game.Workspace.Part.Explosion = Vector3.new(15.5, 0.6, -30)
end
while true do
local p = Instance.new ("Hint")
p.Parent = game.Workspace
p.Text = "Slayer219 helped me make this epical place!"
wait(300)
p:Remove()
end
while true do
game.Workspace.Part.Smoke = Vector3.new(15.5, 0.6, -30)
wait(60)
thing:Remove ()
end

Still no output.
Report Abuse
Phellem is not online. Phellem
Joined: 04 Aug 2011
Total Posts: 1984
31 Mar 2012 11:28 PM
Try my script.
Although you have to wait like 10 minute for the smokes.
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
31 Mar 2012 11:30 PM
Alright, I was hoping to try and make the script on my own, because of the learning concept but I'll just dissect the script.

I'm going to change the wait(600) to wait(10) just to see if it works.
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
31 Mar 2012 11:32 PM
And I forgot to mention this all has to happen when Touched.



*Poker Face*
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
31 Mar 2012 11:33 PM
The Part, I mean is Touched.
Report Abuse
Phellem is not online. Phellem
Joined: 04 Aug 2011
Total Posts: 1984
31 Mar 2012 11:33 PM
o... m... gee.
now im confuse...
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
31 Mar 2012 11:35 PM
I was confused 10 minutes ago when I started making this script....
Report Abuse
Phellem is not online. Phellem
Joined: 04 Aug 2011
Total Posts: 1984
31 Mar 2012 11:36 PM
So you want the loops to start once a Part was touched?
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
31 Mar 2012 11:37 PM
Yup.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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