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

Why aren't the player teleporting and the map loading in?

Asked by
Synth_o 136
6 years ago
local replicatedstorage = game:GetService("ReplicatedStorage")
local status = replicatedstorage:WaitForChild("StatusValue")


while true do 
    for i = 30,0,-1 do 
    status.Value = "Intermission "..i
    wait(1)
    end
    status.Value = "Game in Progress!"
local firstobby = game.ServerStorage["FirstObby"]
status.value = "Teleporting Players"
wait(3)
firstclone = firstobby:Clone().Parent
firstclone = game.workspace 
game.Workspace.FirstObby:BreakJoints()
wait(10)
game.Workspace.FirstObby:Destroy()
status.Value = "Game Over!"




end
-- this last part is what I just added in and it is not working because of this part why?
if firstclone == game.ServerStorage then
    game.Players.Vector3 = Vector3.new(-92.2, 44.9, -538.9)
end

Why isn't this working?

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Lets highlight a few of your errors:

First,lets look at your code

local replicatedstorage = game:GetService("ReplicatedStorage")
local status = replicatedstorage:WaitForChild("StatusValue")


while true do 
    for i = 30,0,-1 do 
    status.Value = "Intermission "..i
    wait(1)
    end
    status.Value = "Game in Progress!"
local firstobby = game.ServerStorage["FirstObby"]
status.value = "Teleporting Players"
wait(3)
firstclone = firstobby:Clone().Parent
firstclone = game.workspace 
game.Workspace.FirstObby:BreakJoints()
wait(10)
game.Workspace.FirstObby:Destroy()
status.Value = "Game Over!"




end
-- this last part is what I just added in and it is not working because of this part why?
if firstclone == game.ServerStorage then
    game.Players.Vector3 = Vector3.new(-92.2, 44.9, -538.9)
end

Error #1 Lets look at this part:

firstclone = firstobby:Clone().Parent
firstclone = game.workspace 

Why are you doing this ^^??You can just write

local firstclone = firstobby:Clone()
firstclone.Parent = game.Workspace

Error #2 Now,lets look at the part when you are removing the map Try not to use :BreakJoints() on parts.Use destroy which you did but lets remove the breakjoints

Error #3 Now lets look at the final part,the teleportation. Why did you put it at the end?The reason its not working is because when you clone a item,it is duplicated into a place.And firstclone is not a part of serverstorage.Also,what is if firstclone == game.ServerStorage then ???

Also,that part will not teleport all players,you are putting a class into a position,which will cause an error.

Alright lets put it into a script

local replicatedstorage = game:GetService("ReplicatedStorage")
local status = replicatedstorage:WaitForChild("StatusValue")

while true do
-- Intermission
for i = 30,1,-1 do
status.Value = "Intermission: "..i 
wait(1)
end
function teleAll(x, y, z)
    local pos = Vector3.new(515.98, 116.081, -211.75)
    for _, plr in pairs(game:GetService("Players"):GetPlayers()) do
        if plr.Character then
            plr.Character:MoveTo(pos)
        end
    end
end
local firstobby = game.ServerStorage.FirstObby

firstobby:Clone().Parent = game.Workspace
status.Value = Teleporting players"
wait(5)
teleAll(515.98, 116.081, -211.75)
wait(10)
game.Workspace.Firstobby:Destroy()
teleAll(-92.2, 44.9, -538.9)
status.Value = "Game Over!"
end

If there are anything wrong,comment.

KXJIMIN

Ad

Answer this question