generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Script that's supposed to teleport players not working?

Previous Thread :: Next Thread 
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
24 Jan 2016 05:45 PM
The script is supposed to teleport players based on their teams after they spawn when a certain value becomes true.

However, the script is not doing anything, and Output has given me nothing. I have no idea what the problem is. Can someone please help me?

Here's the script:

local Playing = game.ServerScriptService.MainGameScript.Variables:WaitForChild("Playing")
local Player = game.Players.LocalPlayer
local TeleVal = Player:WaitForChild("Teleported")
local Map = game.ServerScriptService.MainGameScript.Variables:WaitForChild("Map")

while wait(0.1) do
if Playing.Value == true and TeleVal.Value == false and Map.Value ~= " " then
local Thingy = game.Workspace:WaitForChild("Map")
BB = {}
DD = {}
GG = {}
RR = {}
local Spawns = Map:WaitForChild("Spawns")
local BBS = Spawns:WaitForChild("BBS")
local DDS = Spawns:WaitForChild("DDS")
local GGS = Spawns:WaitForChild("GGS")
local RRS = Spawns:WaitForChild("RRS")
for i,v in ipairs(BBS:GetChildren()) do
if v.Name == "Spawn" then
table.insert(BB,v)
end
end
for i,v in ipairs(DDS:GetChildren()) do
if v.Name == "Spawn" then
table.insert(DD,v)
end
end
for i,v in ipairs(GGS:GetChildren()) do
if v.Name == "Spawn" then
table.insert(GG,v)
end
end
for i,v in ipairs(RRS:GetChildren()) do
if v.Name == "Spawn" then
table.insert(RR,v)
end
end
TeleVal.Value = true
if Player.TeamColor == BrickColor.new("Bright red") then
Player.Character.Humanoid:MoveTo(RR[math.random(1,#RR)].Position)
elseif Player.TeamColor == BrickColor.new("Bright blue") then
Player.Character.Humanoid:MoveTo(BB[math.random(1,#BB)].Position)
elseif Player.TeamColor == BrickColor.new("Bright yellow") then
Player.Character.Humanoid:MoveTo(DD[math.random(1,#DD)].Position)
elseif Player.TeamColor == BrickColor.new("Bright green") then
Player.Character.Humanoid:MoveTo(GG[math.random(1,#GG)].Position)
end
end
end
Report Abuse
Bernkastel2727 is not online. Bernkastel2727
Joined: 23 Sep 2012
Total Posts: 2612
24 Jan 2016 05:47 PM
tl;dr
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
24 Jan 2016 05:49 PM
"tl;dr"

best scripting help of 2016
Report Abuse
DarthStrantax is not online. DarthStrantax
Joined: 31 May 2011
Total Posts: 2610
24 Jan 2016 05:51 PM
ServerScriptService doesn't exist clientside.
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
24 Jan 2016 05:54 PM
"ServerScriptService doesn't exist clientside."

I just changed the script to a regular one, and made Player become "script.Parent" instead.

It still doesn't work
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
24 Jan 2016 06:51 PM
b1
Report Abuse
FrostOver is not online. FrostOver
Joined: 20 Jun 2013
Total Posts: 299
24 Jan 2016 07:06 PM
you can't accses the serverscriptservice from the client
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image