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: what's wrong with this script?

Previous Thread :: Next Thread 
momomarshmallow is not online. momomarshmallow
Joined: 03 Oct 2010
Total Posts: 14347
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 is not online. Giola
Joined: 21 Mar 2015
Total Posts: 53
13 Apr 2015 03:22 PM
if msg == "card!" then
card()
end
Report Abuse
momomarshmallow is not online. momomarshmallow
Joined: 03 Oct 2010
Total Posts: 14347
13 Apr 2015 05:31 PM
aaa it still isnt working, would you minding testing it yourself in studio?
Report Abuse
TimeTicks is not online. 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 is not online. 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
momomarshmallow is not online. momomarshmallow
Joined: 03 Oct 2010
Total Posts: 14347
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 is not online. 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 is not online. 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
momomarshmallow is not online. momomarshmallow
Joined: 03 Oct 2010
Total Posts: 14347
13 Apr 2015 07:57 PM
but it still isn't working and I have no idea why :((
Report Abuse
Npokemonmaster2 is not online. Npokemonmaster2
Joined: 24 Oct 2012
Total Posts: 24
13 Apr 2015 09:01 PM
Any Stack End errors?
Report Abuse
Giola is not online. 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
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