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

help trying to load a model far away from the player?

Asked by 5 years ago
script.Parent.MouseButton1Click:Connect(function()

local targetteamarea = game.Workspace.CurrentMap:FindFirstChild("RedTeamSpawnArea")

if targetteamarea == nil then

return

end

if targetteamarea ~= nil then

local teamfolder = game.Teams

local teamname = teamfolder:FindFirstChild("Red")

if teamname == nil then

print("no team found")

end

if teamname ~= nil then

local plr = game.Players.LocalPlayer

local char = plr.Character

local teamspawn = targetteamarea:WaitForChild("RedSpawn",10)

plr.Team = teamname

char.HumanoidRootPart.CFrame = CFrame.new(teamspawn.Position)

script.Parent.Parent.Parent.Parent.Enabled = false

end

end

end)

Im trying to set the players CFrame to a spawner inside a model using a localscript, but the model is far away and it wont finish loading no matter how long I wait. I tried using findfirstchild, and I tried waitforchild, I even tried extending waitforchild by adding a timeout but nothing works. unless I physically move the object to the player it wont load. is there maybe a way for me to preload areas or another way to find an object locally

0
Do you have streamingenabled? if so turn that off, if not, then check if the part you are trying to teleport the player to is anchored, sometimes parts when not anchored fall off the map popgoesme700 113 — 5y
0
no they are anchored, and yea I have SE enabled, I always enable it when my games are big. mantorok4866 201 — 5y

Answer this question