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

Why does my character teleport away when I hold the woodensword? (urgent)(confused)

Asked by 5 years ago

function onTouch(fire1) local Toucher = fire1.Parent:FindFirstChild("Humanoid") --The toucher

if Toucher ~= nil then --if someone touched our brick Toucher.Torso.CFrame = CFrame.new(-69.5, -6, -53) Toucher.Parent:FindFirstChild("Body Colors").HeadColor = BrickColor.new(24) Toucher.Parent:FindFirstChild("Body Colors").LeftArmColor = BrickColor.new(24) Toucher.Parent:FindFirstChild("Body Colors").RightArmColor = BrickColor.new(24) Toucher.Parent:FindFirstChild("Body Colors").TorsoColor = BrickColor.new(23) Toucher.Parent:FindFirstChild("Body Colors").LeftLegColor = BrickColor.new(119) Toucher.Parent:FindFirstChild("Body Colors").RightLegColor = BrickColor.new(119)

     end

end

script.Parent.Touched:connect(onTouch) --so what im trying to do is to make a part that teleports the toucher as well as color thier body

script.Parent.Touched:connect(function(hit) local find = hit.Parent:FindFirstChild("Humanoid") if find then local player = game.Players:GetPlayerFromCharacter(hit.Parent) local findS = player.Backpack:FindFirstChild("woodensword") if not findS then local sword = game.Lighting.woodensword:Clone() sword.Parent = player.Backpack end end if not find then print('no humanoid') end end)

--this script teleports the character when they step on a part and also color their body and give them a woodensword. However, when i hold the woodensword, i get teleported to the baseplate and my character model's head will get stuck under the baseplate and when i try to swing the sword, my body swings but the sword is stuck there

0
code block please User#17685 0 — 5y
0
CFrame.new(-69.5, 5, -53), Maybe '-6' is too deep. the rest of the problem would be on the sword not this teleport or whatever Script above User#17685 0 — 5y
0
The teleport works fine but when i hold out the sword i het teleported away and my character cant move BakingPeanut -7 — 5y

Answer this question