|
| 13 Apr 2015 03:08 PM |
I'm 99% sure that the problem is not with the function card but with the event that calls on it. anyway here it is, can someone help me fix it?
red = game.StarterGui.RedCard.Frame green = game.StarterGui.GreenCard.Frame yellow = game.StarterGui.YellowCard.Frame blue = game.StarterGui.BlueCard.Frame
function card() local i = math.random(1,4) if i == 1 then red.Visible = true wait(5) red.Visible = false elseif i == 2 then green.Visible = true wait(5) green.Visible = false elseif i == 3 then yellow.Visible = true wait(5) yellow.Visible = false elseif i == 4 then blue.Visible = true wait(5) blue.Visible = false end end
game.Players.PlayerAdded:connect(function(player) if player.Name == "momomarshmallow" then player.Chatted:connect(function(msg) if msg=="card!" then event.connect:(function(card)) end end) end end) |
|
|
| Report Abuse |
|
|
Giola
|
  |
| Joined: 21 Mar 2015 |
| Total Posts: 53 |
|
|
| 13 Apr 2015 03:22 PM |
if msg == "card!" then card() end |
|
|
| Report Abuse |
|
|
|
| 13 Apr 2015 05:31 PM |
| aaa it still isnt working, would you minding testing it yourself in studio? |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 13 Apr 2015 07:50 PM |
| What does your output say? Look at script analysis too. |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 13 Apr 2015 07:53 PM |
red = game.StarterGui.RedCard.Frame green = game.StarterGui.GreenCard.Frame yellow = game.StarterGui.YellowCard.Frame blue = game.StarterGui.BlueCard.Frame
You want to edit the playergui, not the StarterGui |
|
|
| Report Abuse |
|
|
|
| 13 Apr 2015 07:53 PM |
| well like I said, the problem is with getting it to work with the chatted event, so I thought the only way to test it was to go in server and chat the code but then I can't see the output. can I test it another way that let's me see the output? |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 13 Apr 2015 07:55 PM |
| Also note while playing solo, your name is "Player" |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 13 Apr 2015 07:56 PM |
| Or Player1 if you are not connected to roblox on your main game. |
|
|
| Report Abuse |
|
|
|
| 13 Apr 2015 07:57 PM |
| but it still isn't working and I have no idea why :(( |
|
|
| Report Abuse |
|
|
| |
|
Giola
|
  |
| Joined: 21 Mar 2015 |
| Total Posts: 53 |
|
|
| 13 Apr 2015 09:03 PM |
| I am assuming this is a server script. You would be doing it right, except that the player would need to reset to see results. Also, if it were a local script, you could change playergui much more easily because it auto-assumes. |
|
|
| Report Abuse |
|
|