#need help abaout chechkpoınt ın obby

85 messages · Page 1 of 1 (latest)

trim arch
#

show the script you made

inland latch
#

okay

#

1

#

local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")

local checkpoint = script.Parent

function onTouched(hit)
local Humanoid = hit.Parent:FindFirstChildOfClass("Humanoid")
if hit and hit.Parent and Humanoid then
if Humanoid.Health == 0 then return end
local player = Players:GetPlayerFromCharacter(hit.Parent)
local checkpointData = ServerStorage:FindFirstChild("CheckpointData")
if not checkpointData then
checkpointData = Instance.new("Folder")
checkpointData.Name = "CheckpointData"
checkpointData.Parent = ServerStorage
end

    local userIdString = tostring(player.UserId)
    local checkpointValue = checkpointData:FindFirstChild(userIdString)
    if not checkpointValue then
        checkpointValue = Instance.new("ObjectValue")
        checkpointValue.Name = userIdString
        checkpointValue.Parent = checkpointData

        player.CharacterAdded:connect(function(character)
            wait()
            local storedCheckpoint = ServerStorage.CheckpointData[userIdString].Value
            character:MoveTo(storedCheckpoint.Position + Vector3.new(math.random(-4, 4), 4, math.random(-4, 4)))
        end)
    end

    checkpointValue.Value = checkpoint
end

end

checkpoint.Touched:Connect(onTouched)

#

2

#

local songDebounce = false

script.Parent.Touched:Connect(function(CharacterPart)
local Player = game:GetService("Players"):GetPlayerFromCharacter(CharacterPart.Parent)
if Player then
Player:WaitForChild("leaderstats"):WaitForChild("Stage").Value = tonumber(string.split(script.Parent.Name, "t")[2])
if songDebounce == false then
songDebounce = true
script.Parent.Sound:Play()
script.Parent.ParticleEmitter:Emit(20)
wait(3)
songDebounce = false
end
end
end)

trim arch
#

oh

#

you mean facing the wrong way?

inland latch
#

yeah

midnight plinthBOT
#

studio** You are now Level 6! **studio

inland latch
#

ı turned rotate

#

but ıts stıll same

trim arch
#

thats pathfinding..

#

use PivotTo instead

#

and make a cframe that looks into the desired direction

inland latch
#

ıdk thatt...

trim arch
#

probably the LookVector of the spawn

inland latch
#

ı dont understand somethıng from that...

trim arch
inland latch
#

ı used chatgpt for help

inland latch
trim arch
#

oh hell naw

#

dont use ai

#

seriously

inland latch
#

thats why ı want help from here

trim arch
#

you arent gonna learn anything from AI

inland latch
#

yh have u got suggestıon for yt vıedos

trim arch
#

its just gonna tell you the scripts

trim arch
inland latch
#

how u learned thn

trim arch
#

i use Devforum, docs and stack overflow

trim arch
#

specifically

inland latch
#

are they have vıedo or just text

trim arch
#

but they have example videos of what it should look like

inland latch
#

ty

#

ıll use that

trim arch
#

theyre really good do check them out

#

alr

#

np

inland latch
#

whıch command ı should add to my code

trim arch
#

learn scripting because its hard for us to help you if you dont know how to script

#

and we wont just fix scripts for you

#

especially as big as those

inland latch
#

yh you are true

#

ıs there any command

trim arch
#

command?

#

wym

inland latch
#

code* ı mean

trim arch
#

what i told you to do earlier

#

but youre gonna have to learn scripting

#

to do it

inland latch
#

ıs there any code to adjust where chechkpoınt looks

inland latch
#

thıs game almost fınısh

inland latch
inland latch
trim arch
inland latch
#

my englısh ıs not that good

#

wdym sing by here

trim arch
#

i meant "using"

inland latch
#

Ohok

#

Oh so ı should use PivotTo nstead of MoveTo

#

is MoveTo old code?

#

@trim arch sorry ık ı am annyoıng but ı am just new and my english not good at all

trim arch
#

nvm

#

yes

#

its old

inland latch
#

let me try pivot to

trim arch
#

and use the desired CFrame

inland latch
#

yh ı wıll rotate that

#

so I will just use Pivot to instead of MoveTo and determine the direction?

inland latch
#

let me

#

@trim arch

trim arch
#

what

inland latch
#

chechkpoınt ıts not workıng ıf ı use move to