|
for i,v in pairs(game.Players:GetPlayers()) do
if v.TeamColor == BrickColor.new("White") then
v.Character.Torso.CFrame = CFrame.new(Spot1)
elseif v.TeamColor == BrickColor.new("Bright red") then
v.Character.Torso.CFrame = CFrame.new(Spot2)
elseif v.TeamColor == BrickColor.new("Dark Green") then
v.Character.Torso.CFrame = CFrame.new(Spot3)
end
end
its not teleporting at all.... I have no idea why its not (It works in solo mode) |
|
LacrymaJoin Date: 2010-02-15 Post Count: 22696 |
what is spot1 spot2 spot3
how many times are you running this or is this linked to an event. |
|
|
Is it killing the "Character"?. |
|
|
Here is the whole script. The teleportation doesn't kill but the fall does. It is also supposed to be a one time event.
Spot1= Vector3.new(10,10,10)
Spot2= Vector3.new(30,30,30)
Spot3= Vector3.new(20,20,20)
--[[game.Players.PlayerAdded:connect(function()
local num = game.Players:GetPlayers() -- num is an array
if num[1] == nil then -- If there is no more than 1 Player in the array
script.Parent.Sound:Play()
wait(20)
script.Parent.Sound:Stop()
end
end)--]]
for i,v in pairs(game.Players:GetPlayers()) do
if v.TeamColor == BrickColor.new("White") then
v.Character.Torso.CFrame = CFrame.new(Spot1)
elseif v.TeamColor == BrickColor.new("Bright red") then
v.Character.Torso.CFrame = CFrame.new(Spot2)
elseif v.TeamColor == BrickColor.new("Dark Green") then
v.Character.Torso.CFrame = CFrame.new(Spot3)
end
end
function GameGuns()
wait(3)
end
wait()
function GameEnd()
wait(3)
end |
|
|
|
how would I change the right cframe then? |
|
|
And besides I don't want the character to walk there. I want them to instantly teleport. |
|
|
if you do it to the humanoid it will walk there if you do it to the chatactor it will tele
v.Character:MoveTo(Spot3) |
|
|
if it did not work above do
v:MoveTo(Spot1) |
|
|
its still not working
here is the whole thing...
Spot1= Vector3.new(10,10,10)
Spot2= Vector3.new(30,30,30)
Spot3= Vector3.new(20,20,20)
--[[game.Players.PlayerAdded:connect(function()
local num = game.Players:GetPlayers() -- num is an array
if num[1] == nil then -- If there is no more than 1 Player in the array
script.Parent.Sound:Play()
wait(20)
script.Parent.Sound:Stop()
end
end)--]]
for i,v in pairs(game.Players:GetPlayers()) do
if v.TeamColor == BrickColor.new("White") then
v:MoveTo(Spot1)
elseif v.TeamColor == BrickColor.new("Bright red") then
v:MoveTo(Spot2)
elseif v.TeamColor == BrickColor.new("Dark Green") then
v:MoveTo(Spot3)
end
end
function GameGuns()
wait(3)
end
wait()
function GameEnd()
wait(3)
end |
|
sycipsJoin Date: 2011-03-21 Post Count: 1368 |
When a server starts online, there's only one player and no character. In other words, I suppose this is no local but normal script and youve put it in workspace or serverscriptstorage... Theres nothing to teleport!
Instead, make a function and put the content of the for loop in the function. Make a connection to the function with the PlayerAdded event, and I think itll work! I hope youre following me :P
~sycips~ |
|
|
so what you are saying is put that small part in a local script, and add a PlayerAdded event? Right? |
|
|
|
|
I didn't ignore you I tried both things that you suggested. |
|
|
its still not working
here is the whole thing...
Spot1= Vector3.new(10,10,10)
Spot2= Vector3.new(30,30,30)
Spot3= Vector3.new(20,20,20)
--[[game.Players.PlayerAdded:connect(function()
local num = game.Players:GetPlayers() -- num is an array
if num[1] == nil then -- If there is no more than 1 Player in the array
script.Parent.Sound:Play()
wait(20)
script.Parent.Sound:Stop()
end
end)--]]
for i,v in pairs(game.Players:GetPlayers()) do
if v.TeamColor == BrickColor.new("White") then
v.Character:MoveTo(Spot1)
elseif v.TeamColor == BrickColor.new("Bright red") then
v.Character:MoveTo(Spot2)
elseif v.TeamColor == BrickColor.new("Dark Green") then
v.Character:MoveTo(Spot3)
end
end
function GameGuns()
wait(3)
end
wait()
function GameEnd()
wait(3)
end |
|
|
Didn't work should I instead do
--[[game.Players.PlayerAdded:connect(function()
local num = game.Players:GetPlayers() -- num is an array
if num[1] == if v.TeamColor == BrickColor.new("White") then
v.Character:MoveTo(Spot1)
elseif v.TeamColor == BrickColor.new("Bright red") then
v.Character:MoveTo(Spot2)
elseif v.TeamColor == BrickColor.new("Dark Green") then
v.Character:MoveTo(Spot3) -- If there is no more than 1 Player in the array
script.Parent.Sound:Play()
wait(20)
script.Parent.Sound:Stop()
end
end
end
end)--]] |
|
|
Nevermind that didn't work |
|
|
TeamOne = game.Teams.TeamNameHere
for _,v in pairs(game.Players:GetPlayers()) do
if v.TeamColor == TeamOne.TeamColor then
v.Name.Character:MoveTo(Spot1)
end
end |
|
|
woudl I do.
TeamOne.TeamColor("White") ? |
|
|
and its multiple people, so that could also be an issue. |
|
|
No, using something like,
if v.TeamColor == game.Teams.TeamNameHere.Teamcolor then
end
will already retrieve and match the TeamColors. |
|
|
|
well now I am lost
for _,v in pairs(game.Players:GetPlayers()) do
if v.TeamColor == game.Teams.Cool.TeamColor then
if v.TeamColor == TeamOne.TeamColor then
v.Name.Character:MoveTo(Spot1)
end
end
end |
|
LacrymaJoin Date: 2010-02-15 Post Count: 22696 |
You need to connect the tp'ing to an actual event.
When do you need it to function?
And don't use the recent code, it's stupid. |
|