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: chatted event

Previous Thread :: Next Thread 
momomarshmallow is not online. momomarshmallow
Joined: 03 Oct 2010
Total Posts: 14347
13 Apr 2015 08:05 PM
i have this function that I wrote which works fine when I run it in studio but then when I try to activate the function with a chatted event or a touched function it doesn't work. this is my script, please help me write the chatted event if you know how



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
Report Abuse
acidflip is not online. acidflip
Joined: 18 Jul 2012
Total Posts: 886
13 Apr 2015 08:10 PM
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
-- stuff here
end)
end)
Report Abuse
momomarshmallow is not online. momomarshmallow
Joined: 03 Oct 2010
Total Posts: 14347
13 Apr 2015 08:11 PM
yes I found that on the wiki but I don't know what to put in the --stuff here
Report Abuse
iHin is not online. iHin
Joined: 06 Apr 2014
Total Posts: 407
13 Apr 2015 08:11 PM
This person above me gave you to proper framework. Your script didn't call the function. For future reference, post any output statements.



-𝒩 | iHin, Scripter
Report Abuse
momomarshmallow is not online. momomarshmallow
Joined: 03 Oct 2010
Total Posts: 14347
13 Apr 2015 08:12 PM
@hin I tried to call it with the framework ^^ but what I tried wasn't working so I didn't post it, hoping that somebody else would post a correct version
Report Abuse
acidflip is not online. acidflip
Joined: 18 Jul 2012
Total Posts: 886
13 Apr 2015 08:12 PM
put whatever your little heart desires in "--stuff here"
Report Abuse
momomarshmallow is not online. momomarshmallow
Joined: 03 Oct 2010
Total Posts: 14347
13 Apr 2015 08:20 PM
lol but what I meant to say was that I want to connect to the function in the '--stuff here' part but I don't know how to say that correctly
Report Abuse
acidflip is not online. acidflip
Joined: 18 Jul 2012
Total Posts: 886
13 Apr 2015 08:22 PM
function card()
-- whatever was here
end

game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(card)
end)
Report Abuse
momomarshmallow is not online. momomarshmallow
Joined: 03 Oct 2010
Total Posts: 14347
13 Apr 2015 08:29 PM
sorry I keep asking questions but what about the actual message part (where do I put what the code is?)
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
13 Apr 2015 08:30 PM
red = game.StarterGui.RedCard.Frame
green = game.StarterGui.GreenCard.Frame
yellow = game.StarterGui.YellowCard.Frame
blue = game.StarterGui.BlueCard.Frame

I think you want to edit the playergui, not startergui
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