Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How do you disable a Teleporter using a message script?

Asked by 10 years ago

I'm really confused on how to make a script that will disable two of my Teleporters (Ingame teleport, to another area of the same game, not to another place), which are linked. I want to do it so I can make it disabled using a message. But it keeps coming up with errors. I also want to be able to make it enabled again.

This is what I've done so far:

admin = {"MasterPoke99"}


game.Players.PlayerAdded:connect(function(p) 
for _,v in pairs(admin) do if p.Name:lower() == v:lower() then p.Chatted:connect(function(m)  
m = m:lower()

tele = script.Parent enable = script.Parent.Teleport 

if m == "open sft" or "open secret" or "open teles" or "close arena" or "open vote" then wait(1) 

tele.Transparency = 1 
tele.CanCollide = false 
script.Disabled = true 

elseif m == "Self-Training" then 
wait(1) tele.Transparency = 0 
tele.CanCollide = true 
script.Disable = false 

end end) end end)

Could someone help me make a working one? Doesn't have to be similar to this. Thanks!

1 answer

Log in to vote
0
Answered by
trogyssy 221 Moderation Voter
10 years ago

first of all, that's way too many ends second, is there a variable set up called "enable"?

admin = {"MasterPoke99"}

game.Players.PlayerAdded:connect(function(p)
for _,v in pairs(admin) do if p.Name:lower() == v:lower() then p.Chatted:connect(function(m) 
m = m:lower()

tele = script.Parent enable = script.Parent.Teleport

if m == "open sft" or "open secret" or "open teles" or "close arena" or "open vote" then wait(1)

tele.Transparency = 1 
tele.CanCollide = false 
enable.Disabled = true

elseif m == "Self-Training" then 
wait(1) tele.Transparency = 0 
tele.CanCollide = true 
enable.Disabled = false

end end) end end)
0
Thanks, that's cool. I believe there is a function called enable, because I've seen it in scripts before. And yeah, I had a feeling about too many ends, I wasn't quite sure how many to put in, I'm not good with the ends. Thanks, I'll try it out. DerpyShadowz 34 — 10y
0
Okay, so I've done all of it, but it said that there was errors on the 'end end) end end)' bit, I haven't tested it out yet, but I want to see first if you know the problem. Thanks! DerpyShadowz 34 — 10y
0
Please give the exact text of the error(s) and the modified script. trogyssy 221 — 10y
0
The text of the errors if the last bit of your one. And I've completed modified it to yours above. DerpyShadowz 34 — 10y
View all comments (2 more)
0
Please copy and paste the error(s) trogyssy 221 — 10y
0
end end) end end) DerpyShadowz 34 — 10y
Ad

Answer this question