Hello,
I am stuck with my problem. When i die or respawn first time on this checkpoint i am flying down to up on the platform i dont know what is problem, beacuse i off collision on players and of this block i need some help. I just wanna respawn on this platform without “flying”
script.Parent = game:GetService("ServerScriptService")
local physic = game:GetService("PhysicsService")
local plagr = physic:CreateCollisionGroup("p")
local kloc = physic:CollisionGroupSetCollidable("p","kloc", false)
physic:CollisionGroupSetCollidable("p","p", false)
function NoCollide(model)
for k,v in pairs(model:GetChildren()) do
if v:IsA"BasePart" then
physic:SetPartCollisionGroup(v,"p")
end
end
end
game:GetService("Players").PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
char:WaitForChild("HumanoidRootPart")
char:WaitForChild("Head")
char:WaitForChild("Humanoid")
wait(.1)
NoCollide(char)
end)
if player.Character then
NoCollide(player.Character)
end
end)
I’m pretty sure SpawnLocations make you spawn in the middle of the Spawn’s Base Position when you first spawn in (So you would technically spawn a bit higher rather than the ground part)
ye but i have script for checkpoint and its not working with this
Checkpoint scripts:
local checkpoint = workspace.Checkpoint
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local stage = Instance.new("IntValue")
stage.Name = "Stage"
stage.Value = 1
stage.Parent = leaderstats
player.CharacterAdded:Connect(function(char)
local hum = char:WaitForChild("Humanoid")
wait()
char:MoveTo(checkpoint[stage.Value].Position)
hum.Touched:Connect(function(hit)
if hit.Parent == checkpoint then
if hum.Health == 0 then
return
end
if tonumber(hit.Name) == stage.Value + 1 then
stage.Value = stage.Value + 1
end
end
end)
end)
MoveTo() might be causing the issue, cause that positions Models in relation with collisions which can be a bit janky
Try using SetPrimaryPartCFrame() instead and move the Character a bit down:
local checkpoint = workspace.Checkpoint
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local stage = Instance.new("IntValue")
stage.Name = "Stage"
stage.Value = 1
stage.Parent = leaderstats
player.CharacterAdded:Connect(function(char)
local hum = char:WaitForChild("Humanoid")
wait()
char:SetPrimaryPartCFrame(CFrame.new(checkpoint[stage.Value].Position + Vector3.new(0, -20, 0)))
hum.Touched:Connect(function(hit)
if hit.Parent == checkpoint then
if hum.Health == 0 then
return
end
if tonumber(hit.Name) == stage.Value + 1 then
stage.Value = stage.Value + 1
end
end
end)
end)
end)