|
| 17 May 2012 08:24 AM |
Hi there. I am working on a game called "BlockCraft" and I am trying to make a contest area. I cannot get the script to work. I also want it to only respond to my name. Here is the script so far:
door = script.Parent --Door
function onChatted(msg,speaker) --Message, speaker's name
if (msg == "opencontest") then --Don't edit. if door.Transparency = 0.9 and door.CanCollide = false then end else door.Transparency = 0.9 door.CanCollide = false end
if (msg == "closecontest") then --Don't edit. if door.Transparency = 1 and door.CanCollide = true then end else door.Transparency = 1 door.CanCollide = true end
function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) end
game.Players.ChildAdded:connect(onPlayerEntered)
I can't figure out what's wrong with it. Please help me with it. Thanks. |
|
|
| Report Abuse |
|
agent767
|
  |
| Joined: 03 Nov 2008 |
| Total Posts: 4181 |
|
|
| 17 May 2012 08:36 AM |
door = script.Parent --Door
function onChatted(msg,speaker) --Message, speaker's name
if (msg == "opencontest") then --Don't edit. if door.Transparency == 0.9 and door.CanCollide == false then return else door.Transparency = 0.9 door.CanCollide = false end
elseif (msg == "closecontest") then --Don't edit. if door.Transparency == 1 and door.CanCollide == true then return else door.Transparency = 1 door.CanCollide = true end end end
function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) end
game.Players.ChildAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|