Can't figure out how to make a skip

hello everyone

for a bit I’ve been trying to make a skip stage remote event for my obby but I can’t figure out how I’ve tried a lot of things but I can’t get it to work so I restarted because it was just giving warnings like “value of type Instance cannot be converted to a number” and I can’t figure out how to make this. I tried a lot of things…

game.ReplicatedStorage.Remotes.SkipStage.OnServerEvent:Connect(function(player, stageNumberToSkipTo)
	player.leaderstats.Stage.Value = stageNumberToSkipTo
	player.Character.HumanoidRootPart.CFrame = partToTeleportTo.CFrame + Vector3.new(0, 3, 0)
end)

image

1 Like

what is the partToTeleportTo variable representing?

You are probably doing

Remote:FireServer(game.Players.LocalPlayer, stageNumber)

convert to this
Remote:FireServer(stageNumber)

1 Like

the checkpoint parts inside the folder like 1,2,3,4,5 etc

What this tells you, is that you’re trying to use an Instance as a number.

‘stageNumberSkipTo’ is probably an instance instead of a number.

game.ReplicatedStorage.Remotes.SkipStage.OnServerEvent:Connect(function(player, stageNumberToSkipTo)
	player.leaderstats.Stage.Value = stageNumberToSkipTo.Name
	player.Character.HumanoidRootPart.CFrame = stageNumberToSkipTo.CFrame + Vector3.new(0, 3, 0)
end)
1 Like

the problem is i use a custom character and the custom character does not have a humanoid root part
image

Thats an issue. Most, if not all rigs need a HumanoidRootPart to either work properly, or do things such as teleporting. At the very least, it needs a Primary part set

how do i add a humanoid root to my custom character tho?

CUSTOM.rbxm (12.0 KB)

Just duplicate the torso, make it transparent, name it HumanoidRootPart, and rig the torso to the RootPart

uhhhhhh im sorry but i sadly dont know how to do that.
CUSTOM.rbxm (12.0 KB)

What do you mean you dont know how? If you made a custom rig, then you can easily just duplicate a part and rig the torso to it.

ok i welded it and it works but i need to figure out some other stuff

hey this script just teleports you to level one

when i execute

game.ReplicatedStorage.Remotes.SkipStage:FireServer(game.Players.Alfiepro98234, 6)

You arent supposed to weld it, youre meant to rig it.

does that affect the script in anyway??

I mean, in this instance, no, but its just generally not a good idea to weld it.

donot pass the player in remote events because they are passed to the server automatically as the first argument like MrOnlyKemal said that is why you are getting the error "Value of type Instance cannot be converted into number"

you can use the PivotTo method on the character model to move it

characterModel:PivotTo(add checkpoint cframe here)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.