GriloxJoin Date: 2007-07-15 Post Count: 119 |
I'm working on a script that allows someone to open or close a trapdoor using a secret code word.
Here's the script I'm using that isnt working
model=game.Workspace.trapdoor
function onChatted(msg, recipient, speaker)
local source = string.lower(speaker.Name)
msg = string.lower(msg)
if (msg == "hamburger") then
model.Transparency = 1
model.CanCollide = false
end
if (msg == "we must preserve secrecy") then
model.Transparency = 0
model.CanCollide = true
end
function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end
game.Players.ChildAdded:connect(onPlayerEntered) |
|
GriloxJoin Date: 2007-07-15 Post Count: 119 |
Any Ideas? I still can't figure out what is wrong. |
|
GriloxJoin Date: 2007-07-15 Post Count: 119 |
Does anyone have any inkling of what could be wrong? I really need a working code. |
|
|
WaffleBoyJoin Date: 2007-03-21 Post Count: 1377 |
It's missing an end before the "function onplayerentered." |
|
GriloxJoin Date: 2007-07-15 Post Count: 119 |
Hm? It has an end before that. Or am I misunderstanding you? |
|
WaffleBoyJoin Date: 2007-03-21 Post Count: 1377 |
end
end
There's another end after the last message. |
|
GriloxJoin Date: 2007-07-15 Post Count: 119 |
I removed the ends but It still dosent work. Now it looks like:
model=game.Workspace.trapdoor
function onChatted(msg, recipient, speaker)
local source = string.lower(speaker.Name)
msg = string.lower(msg)
if (msg == "hamburger") then
model.Transparency = 1
model.CanCollide = false --Make trapdoor disappear and have anyone on the brick fall through
end
if (msg == "we must preserve secrecy") then
model.Transparency = 0
model.CanCollide = true --Return brick to normal condition
end
function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer))
game.Players.ChildAdded:connect(onPlayerEntered) |
|
|
he ment this
model=game.Workspace.trapdoor
function onChatted(msg, recipient, speaker)
local source = string.lower(speaker.Name)
msg = string.lower(msg)
if (msg == "hamburger") then
model.Transparency = 1
model.CanCollide = false --Make trapdoor disappear and have anyone on the brick fall through
end
if (msg == "we must preserve secrecy") then
model.Transparency = 0
model.CanCollide = true --Return brick to normal condition
end
function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer))
end
end
game.Players.ChildAdded:connect(onPlayerEntered) |
|
|
U KNOW WHER I CAN GET ROCKET SCRIPT AD HOW TO USE IT (ITS MY FIRST TIME) |
|
|
Hmm... Re-do it and try again, if that's the case |
|
GriloxJoin Date: 2007-07-15 Post Count: 119 |
Even the new script by lavamaster didn't work... dang... |
|
AnaminusTop 100 PosterJoin Date: 2006-11-29 Post Count: 5945 |
------------------------------------------------------------------------------
model=game.Workspace.trapdoor
function onChatted(msg, recipient, speaker)
local source = string.lower(speaker.Name)
msg = string.lower(msg)
if (msg == "hamburger") then
model.Transparency = 1
model.CanCollide = false --Make trapdoor disappear and have anyone on the brick fall through
end
if (msg == "we must preserve secrecy") then
model.Transparency = 0
model.CanCollide = true --Return brick to normal condition
end
end
function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end
game.Players.ChildAdded:connect(onPlayerEntered)
-------------------------------------------------------------------------------------
Indents. INDENTS.
?-Anaminus-? |
|