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

How to make an checkpoint system for an obby? [closed]

Asked by 5 years ago
Edited 5 years ago

So basically i have a couple stages of an obby and i want to have checkpoints. Everywhere online it tells me to allow team change on touch etc. For some reason it doesn't work for me and i feel like even if its done it will spawn me in one of the many spawnblocks so i personally think its unreliable.

Currently i want to know whether i can manipulate the spawnlocation specifically which looks something like this:

player.SpawnLocation=currentStage(changed though touching a block)

I have another question, how would write a statement which says "if in contact with 3rd party object"

Apologiese for the terrible explanation Thank you!

0
Im trying to make a small obby game by today and cant test if i teleport to random areas of the map Gamerzhi 4 — 5y
1
player Objects have a property called 'RespawnLocation,' which determines what Spawn location the player will spawn at Rare_tendo 3000 — 5y

Closed as Not Constructive by User#19524

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
green271 635 Moderation Voter
5 years ago

The player object has a property called RespawnLocation. This property allows you to manipulate the spawn location of the player.

Insert a script into your spawnlocation with this code:

script.Parent.Touched:Connect(function(Hit)
    if Hit.Parent:FindFirstChild("Humanoid") then -- checking if the hit is a player
        local char = Hit.Parent
        local player = game.Players:GetPlayerFromCharacter(char) -- getting player 
        if player then 
            player.RespawnLocation = script.Parent
        end
    end
end)

As for your second question, you can also use .Touched to detect if the player is in contact with X object.

Ad