what’s the problem please help i’m from yesterday trying to solve the problem
@lrd14 @Bruh_YourePro
Could you also show a picture of your workspace in the explorer window?
From what I can tell, you don’t set RMASpawn
if the half
variable isn’t equal to 1
, so in your for loop, you’re treating it as if it exists when it doesn’t, hence you get the “can’t index nil with CFrame” error
they are in the workspace so what’s the problem?
Have you tried using HumanoidRootPart?
local hrp = character:FindFirstChild("HumanoidRootPart")
hrp.CFrame = RMASpawn.CFrame
When half
is 1
you are setting RMAScore
and BARScore
instead of RMASpawn
and BARSPawn
.
Like DevAX1T said.
so i have to reverse it???
or what??
omg i was dumb. thanks i’ll give you and him a solution
can i ask you something else how can i make a lot of teleport not one like
this commands i want it to be like
RMASpawn = workspace.Team1Spawn, Team3Spawn, Team5Spawn, Team7Spawn
BARSpawn = workspace.Team2Spawn, Team3Spawn, Team6Spawn, Team8Spawn
but i need it work. so how? please reply fast.
You can use the CollectionService to add tags
then do something like this
if half == 1 then
RMASpawns = CollectionService:GetTagged("Team1Spawn")
BARSpawns = CollectionService:GetTagged("Team2Spawn")
else
RMASpawns = CollectionService:GetTagged("Team2Spawn")
BARSpawns = CollectionService:GetTagged("Team1Spawn")
end
Then RMASpawns
and BARSpawns
are arrays of spawn positions
so i do this ?
if half == 1 then
RMASpawns = CollectionService:GetTagged(“Team1Spawn”, “Team3Spawn”)
BARSpawns = CollectionService:GetTagged(“Team2Spawn”, “Team4Spawn”)
else
RMASpawns = CollectionService:GetTagged(“Team2Spawn”, “Team3Spawn”)
BARSpawns = CollectionService:GetTagged(“Team1Spawn”, “Team4Spawn”)
end
No I mean that you give every spawn of team 1 the Team1Spawn
tag and every spawn of team 2 the Team2Spawn
tag.
ok i understand now!! thanks!!
CollectionService is not a thing
where i can find tag editor???
i found it
umm back to the main problem?!
This is a different issue. Spawns is now an array, you have to index a specific spawn from the list to be able to get it’s CFrame.
-- btw I'm pretty sure just setting the hrp's cframe doesn't work, so here is how I would do it
character:PivotTo( RMASpawns[math.random(#RMASpawns)].CFrame )
Did you add the tags correctly? This happens because RMASpawns
is an empty array. So CollectionService couldn’t find anything with the "Team1Spawn"
tag