Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Help with functions!?(Is this script right?)

Here is the script (Credit to BlueTalsem)

function onTouch(touchingPart)
    local Player = touchingPart.Parent;
    if Player and Player:FindFirstChild("Torso") then
Player.Torso.CFrame = Player.Torso.CFrame + Vector3.new(8, 9, 1);
local p = Instance.new("Part",Workspace);
p.Position = Part.Position;
for i = 1, 10 do
    local p = Instance.new("Part",Workspace);
    p.Position = Part.Position;
end
local part = Instance.new("Explosion")
    end
end
Part.Touched:connect(onTouch)

3 comments

0

Please test the script yourself. We are not your personal testers, we are here to help fix any bugs you don't know how to fix yourself.

0

Line 9, you didn't define 'Part'

0

Thanks Shawnyg

2 answers

It does work.. or at least should. I see no errors.

Can't you test it and find out for yourself?

it may be the line

if Player and Player:FindFirstChild("Torso") then

try this one

if Player~=nil and Player:FindFirstChild("Torso") then

also use print() to show how far the code runs

This discussion is preserved as it was. New answers, comments, and votes are closed.