pwnful
|
  |
| Joined: 03 Oct 2008 |
| Total Posts: 10505 |
|
|
| 26 Sep 2009 02:43 PM |
A non-working GUI script. Whats wrong with it?
_______________________________________________________________
if Parent.event = MouseButton1Down() then
local i = (math.random(1,10))
if i = 1 then script.Parent.Text = ("This game rox!") else
if i = 2 then script.Parent.Text = ("This game su-(Asplodes)") else
if i = 3 then script.Parent.Text = ("I wish there were carts") else
if i = 4 then script.Parent.Text = ("I shall imprison you!") else
if i = 5 then script.Parent.Text = ("TI>< Pl0><") else
if i = 6 then script.Parent.Text = ("Wowsham kills!") else
if i = 7 then script.Parent.Text = ("1x1x1x1- Killer or MOD?") else if i = 8 then script.Parent.Text = ("Ohaider") else
if i = 9 then script.Parent.Text = ("All toasters toast toast!") else
if i = 10 then script.Parent.Text = ("Tonight, The Bloxxers Live!")
wait(3)
script.Parent.Text = ("Talk to me. I'm your pet.") ____________________________________________________________________
Its supposed to make a GUI space "Talk" to you when you click it. It's supposed to achieve this by generating a random number from 1 - 10, and depending on the number, the name changes. I think the MouseButton1Down event is what's broken, because it does nothing.
Halp! |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2009 02:46 PM |
if Parent.event = MouseButton1Down() then
local i = (math.random(1,10))
if i = 1 then script.Parent.Text = ("This game rox!") else
if i = 2 then script.Parent.Text = ("This game su-(Asplodes)") elseif i = 3 then script.Parent.Text = ("I wish there were carts") elseif i = 4 then script.Parent.Text = ("I shall imprison you!") elseif i = 5 then script.Parent.Text = ("TI>< Pl0><") elseif i = 6 then script.Parent.Text = ("Wowsham kills!") elseif i = 7 then script.Parent.Text = ("1x1x1x1- Killer or MOD?") elseif i = 8 then script.Parent.Text = ("Ohaider") elseif i = 9 then script.Parent.Text = ("All toasters toast toast!") elseif i = 10 then script.Parent.Text = ("Tonight, The Bloxxers Live!")
wait(3)
script.Parent.Text = ("Talk to me. I'm your pet.") |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 26 Sep 2009 02:47 PM |
| Cheeks did barely anything to help the poor guy. |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2009 02:49 PM |
script.Parent.MouseButton1Click:connect(function() local i = (math.random(1,10)) if i = 1 then script.Parent.Text = ("This game rox!") elseif i = 2 then script.Parent.Text = ("This game su-(Asplodes)") elseif i = 3 then script.Parent.Text = ("I wish there were carts") elseif i = 4 then script.Parent.Text = ("I shall imprison you!") elseif i = 5 then script.Parent.Text = ("TI>< Pl0><") elseif i = 6 then script.Parent.Text = ("Wowsham kills!") elseif i = 7 then script.Parent.Text = ("1x1x1x1- Killer or MOD?") elseif i = 8 then script.Parent.Text = ("Ohaider") elseif i = 9 then script.Parent.Text = ("All toasters toast toast!") elseif i = 10 then script.Parent.Text = ("Tonight, The Bloxxers Live!") end wait(3) script.Parent.Text = ("Talk to me. I'm your pet.") end) |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 26 Sep 2009 02:50 PM |
| electric... ever used tables? |
|
|
| Report Abuse |
|
|
pwnful
|
  |
| Joined: 03 Oct 2008 |
| Total Posts: 10505 |
|
| |
|
|
| 26 Sep 2009 02:53 PM |
| i just copied his, you really think i'll rewrite all that? PFFF no thanks xD |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 26 Sep 2009 02:55 PM |
stuff={"This game rox!","This game su-(Asplodes)","I wish there were carts","I shall imprison you!","TI>< Pl0><","Wowsham kills!","1x1x1x1- Killer or MOD?","Ohaider","All toasters toast toast!","Tonight, The Bloxxers Live!"}
script.Parent.MouseButton1Click:connect(function() local i = math.random(1,#stuff)) script.Parent.Text = stuff[i] wait(3) script.Parent.Text = ("Talk to me. I'm your pet.") end) |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2009 02:59 PM |
| i just noticed the () but i dun think that was the reason it didn't work? |
|
|
| Report Abuse |
|
|
pwnful
|
  |
| Joined: 03 Oct 2008 |
| Total Posts: 10505 |
|
|
| 26 Sep 2009 03:01 PM |
Not even blocco's worked. Wow O_O. |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 26 Sep 2009 03:01 PM |
| ph noes... i didn't take out the ( and )'s... just take that out and it'll be fine. But seriously... pwnful doesn't know how to make a string? |
|
|
| Report Abuse |
|
|
nightname
|
  |
| Joined: 10 Jun 2008 |
| Total Posts: 8960 |
|
|
| 26 Sep 2009 03:03 PM |
blocco made a few mistakes:
stuff = {"This game rox!", "This game su-(Asplodes)", "I wish there were carts", "I shall imprison you!", "TI>< Pl0><", "Wowsham kills!", "1x1x1x1- Killer or MOD?", "Ohaider", "All toasters toast toast!", "Tonight", "The Bloxxers Live!"}
script.Parent.MouseButton1Click:connect(function() local i = math.random(1,#stuff)) script.Parent.Text = stuff[i] wait(3) script.Parent.Text = ("Talk to me. I'm your pet.") end) |
|
|
| Report Abuse |
|
|
pwnful
|
  |
| Joined: 03 Oct 2008 |
| Total Posts: 10505 |
|
|
| 26 Sep 2009 03:03 PM |
| I wasn't thinking today... |
|
|
| Report Abuse |
|
|
nightname
|
  |
| Joined: 10 Jun 2008 |
| Total Posts: 8960 |
|
|
| 26 Sep 2009 03:03 PM |
@Blocco
you forgot some "s thats why Tonight was a nil vaule. |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 26 Sep 2009 03:05 PM |
| I copyed and pasted... i didn't forget the "'s... It just didn't copy. |
|
|
| Report Abuse |
|
|
nightname
|
  |
| Joined: 10 Jun 2008 |
| Total Posts: 8960 |
|
|
| 26 Sep 2009 03:07 PM |
@Blocco
Oops late post. Anyway yes you did make a mistake with the () but i think you know. |
|
|
| Report Abuse |
|
|
pwnful
|
  |
| Joined: 03 Oct 2008 |
| Total Posts: 10505 |
|
|
| 26 Sep 2009 03:08 PM |
I think I'll just abandon this... Nothing's working.
But thanks for the slap in the face about strings. |
|
|
| Report Abuse |
|
|