#need help abaout chechkpoınt ın obby
85 messages · Page 1 of 1 (latest)
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)
yeah
** You are now Level 6! **
wait why are you sing :MoveTo?
thats pathfinding..
use PivotTo instead
and make a cframe that looks into the desired direction
ıdk thatt...
probably the LookVector of the spawn
ı dont understand somethıng from that...
how much scripting do you know then
ı used chatgpt for help
ı started 4 day ago
thats why ı want help from here
you arent gonna learn anything from AI
yh have u got suggestıon for yt vıedos
its just gonna tell you the scripts
i dont use yt tutorials
how u learned thn
i use Devforum, docs and stack overflow
the official roblox ones
specifically
i learnt from this one https://create.roblox.com/docs/tutorials/scripting/basic-scripting/intro-to-scripting
are they have vıedo or just text
its text & images mostly
but they have example videos of what it should look like
whıch command ı should add to my code
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
code* ı mean
yeah
what i told you to do earlier
but youre gonna have to learn scripting
to do it
ıs there any code to adjust where chechkpoınt looks
ı wıll but
thıs game almost fınısh
ıts a lıttle game but ı need fınıh to start learıng from zero
whıch code ı should use
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
let me try pivot to
and use the desired CFrame
yh ı wıll rotate that
so I will just use Pivot to instead of MoveTo and determine the direction?
yea
what
chechkpoınt ıts not workıng ıf ı use move to