Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you disable a Teleporter using a message script?

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

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)

6 comments

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.

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!

0

Please give the exact text of the error(s) and the modified script.

0

The text of the errors if the last bit of your one. And I've completed modified it to yours above.

0

Please copy and paste the error(s)

0

end end) end end)

This discussion is preserved as it was. New answers, comments, and votes are closed.