You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
A teleporter where if the player touches it, it checks for all body parts and pushes them into the main teleporter part.
What is the issue? Include screenshots / videos if possible!
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
None, No.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that itβs easier for people to help you!
-- This is an example Lua code block
Please do not ask people to write entire scripts or design entire systems for you. If you canβt answer the three questions above, you should probably pick a different category.
local Players=game:GetService("Players")
local Portal=script.Parent
local debounce=false
local connection;connection=Portal.Touched:Connect(function(hit)
local character=hit.Parent
local humanoid=character:FindFirstChild("Humanoid")
if humanoid and debounce==false then
debounce=true
local player=Players:GetPlayerFromCharacter(character)
if player.Name==game.Players.LocalPlayer.Name then
local cc=character:GetChildren()
character:GetChildren()
for i,v in ipairs(cc) do
if cc:IsA("Part")then
local ts=game:GetService("TweenService")
local tweenInfo=TweenInfo.new(2,Enum.EasingStyle.Elastic,Enum.EasingDirection.In)
local posa={
Vector3.new(cc.Position),
Vector3.new(7.25,6.1,64.25)
}
for _,pos in pairs(posa)do
ts:Create(cc,tweenInfo,{Position=pos}):Play()
wait(2.5)
end
end
game:GetService("TeleportService"):Teleport(72223100044954)
end
wait(2)
debounce=false
end
end
end)
local Players=game:GetService("Players")
local Portal=script.Parent
local debounce=false
local connection;connection=Portal.Touched:Connect(function(hit)
local character=hit.Parent
local humanoid=character:FindFirstChild("Humanoid")
if humanoid and debounce==false then
debounce=true
local player=Players:GetPlayerFromCharacter(character)
if player.Name==game.Players.LocalPlayer.Name then
local cc=character:GetChildren()
for _,v in ipairs(cc) do
if v:IsA("BasePart")then
local ts=game:GetService("TweenService")
local tweenInfo=TweenInfo.new(2,Enum.EasingStyle.Elastic,Enum.EasingDirection.In)
local posa={
Vector3.new(cc.Position),
Vector3.new(7.25,6.1,64.25)
}
for _,pos in pairs(posa)do
ts:Create(v,tweenInfo,{Position=pos}):Play()
task.wait(2.5)
end
end
game:GetService("TeleportService"):Teleport(72223100044954)
end
task.wait(2)
debounce=false
end
end
end)
Hereβs fixed version (There was a typo on the If v:IsA("BasePart") then line.