|
| 22 Oct 2012 11:31 AM |
this is a script of mine and I can't check output because it is supposed to happen when a person talks (me)
You can get a copy of the model or look at the script below : http://www.roblox.com/Help-PLZ-item?id=95784554 what do you think is wrong?'
if string.sub(msg:lower(), 1, 13) == "wheels/orange" then for _,v in pairs(game.Workspace.Camaro:GetChildren())do if v.Name=="Wheels"then v.BrickColor=BrickColor.new("Deep orange") end end end game.Players.PlayerAdded:connect(function(player) if player.Name:lower() == "theuntimelydoctor" then player.Chatted:connect(chat) end end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Oct 2012 11:40 AM |
| You didn't have a function called Chat. Connect the function AFTER the actual function ends,not the start. That makes it more confusing. |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2012 11:41 AM |
| Huh? BTW update output says this (even when I don't talk) (line 1) attempt to index global 'msg' (a nil value) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 22 Oct 2012 12:20 PM |
You forgot to wrap your message code in a function, so that it can be connected to an event.
function chat(msg) if string.sub(msg:lower(), 1, 13) == "wheels/orange" then for _,v in pairs(game.Workspace.Camaro:GetChildren())do if v.Name=="Wheels"then v.BrickColor=BrickColor.new("Deep orange") end end end end game.Players.PlayerAdded:connect(function(player) if player.Name:lower() == "theuntimelydoctor" then player.Chatted:connect(chat) end end) |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2012 12:32 PM |
| I updated the model, now there is no syntax but it isn't doing anything. Please take a look at the model. |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2012 12:41 PM |
| F.Y.I Wheels is a group of 4 wheels is the problem that I'm trying to change the group's color instead of its children (I want to change its children) if so how would I do that? |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2012 12:41 PM |
Are you testing in Solo or Online mode?
In Solo mode, the player joins the game before scripts are run, therefore missing the PlayerAdded event. |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2012 12:56 PM |
| I'm doing it on online mode. What should I do? Also am I selecting the children of wheels and changing the color of them? |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Oct 2012 01:10 PM |
| @big it is a car for more info look at the model link at the top of the page. |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2012 05:58 PM |
| BUMP (REALLY need help D:) |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2012 06:00 PM |
| There's no error in your script. Why not manually change the Brickcolor of the wheels? |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2012 06:05 PM |
| Because I have orange, blue, green, etc it is a voice customized car. I started with the wheels. Can you take a look at the model for me because it doesn't seem to work even though there is no errors (Make sure to change the name to your name) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|