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

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

Asked by 4 years ago

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

Log in to vote
0
Answered by 4 years ago
Edited by royaltoe 4 years ago

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 )
0
So would it be character:modelSetPrimaryPartCFrame(AvailableSpawnPoints[1].CFrame) = AvailableSpawnPoints[1].CFrame table.remove(AvailableSpawnPoints,1) canihavedatcookie 0 — 4y
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. Ziffixture 6913 — 4y
0
Now it just gives me CFrame is not a valid memeber of weld canihavedatcookie 0 — 4y
Ad

Answer this question