Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

When Teleporting players i get Argument 1 missing or nil error?

im trying to make a sword fighting game but When i try to teleport players to a spawnpoint in the map i get this error any help?

character:SetPrimaryPartCFrame()("HumanoidRootPart").CFrame = AvailableSpawnPoints[1].CFrame table.remove(AvailableSpawnPoints,1)

1 answer

In the beginning of your code you stated

character:SetPrimaryPartCFrame()("HumanoidRootPart").CFrame

this syntax is invalid, the correct syntax would be

character:SetPrimaryPartCFrame(AvailableSpawnPoints[1].CFrame)

For future reference the syntax of :SetPrimaryPartCFrame is as follows;

model:SetPrimaryPartCFrame( -- desired CFrame location here )

3 comments

0

So would it be character:modelSetPrimaryPartCFrame(AvailableSpawnPoints[1].CFrame) = AvailableSpawnPoints[1].CFrame table.remove(AvailableSpawnPoints,1)

0

SetPrimaryPartCFrame sets the CFrame of model to the given argument. You passed the first element within AvailableSpawnPoints. You cannot use an = operator afterwards, nor ever with this scenario as it does not compile the way you think it does. The code provided above, is your answer.

0

Now it just gives me CFrame is not a valid memeber of weld

This discussion is preserved as it was. New answers, comments, and votes are closed.