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

Not shooting out?

Asked by 8 years ago

This is supposed to shoot out a sphere a "Potato Thrower" but it does nothing.

local sp=script.Parent

local head=sp:WaitForChild("Head")

function shootpotato()
    local fireball=Instance.new("Part")
    potato.name="Effect"
    potato.BrickColor=BrickColor.new("Bright Yellow")
    potato.Shape="Ball"
    potato.Size=Vector3(2,2,2)
    potato.canCollide=false
    potato.CFrame=head.CFrame
    potato.Velocity=head.CFrame.lookVector*50
    potato.TopSurface("Smooth")
    potato.BottomSurface("Smooth")
    potato.Parent=game.Workspace

end

while true do
    wait(2)
    shootpotato()
end

2 answers

Log in to vote
0
Answered by 8 years ago
local sp=script.Parent

local head=sp:WaitForChild("Head")

function shootpotato()
    local fireball=Instance.new("potato")
    potato.name="Effect"
    potato.BrickColor=BrickColor.new("Bright Yellow")
    potato.Shape="Ball"
    potato.Size=Vector3(2,2,2)
    potato.canCollide=false
    potato.CFrame=head.CFrame
    potato.Velocity=head.CFrame.lookVector*50
    potato.TopSurface("Smooth")
    potato.BottomSurface("Smooth")
    potato.Parent=game.Workspace

end

while true do
    wait(2)
    shootpotato()
end

This may be wrong, but you are creating a "Part" but trying to change a property of "potato". There may be another problem as you are not defining the location of "potato" and maybe "Effect" has something to do with it. If I'm wrong, just say.

Ad
Log in to vote
0
Answered by
KenzaXI 166
8 years ago
local sp=script.Parent

local head=sp:WaitForChild("Head")

function shootpotato()
    local fireball=Instance.new("Part")
    potato.name="Effect"
    potato.BrickColor=BrickColor.new("Bright Yellow")
    potato.Shape="Ball"
    potato.Size=Vector3(2,2,2)
    potato.canCollide=false
    potato.CFrame=head.CFrame
    potato.Velocity=head.CFrame.lookVector*50
    potato.TopSurface("Smooth")
    potato.BottomSurface("Smooth")
    potato.Parent=game.Workspace

end

while true do
    wait(2)
    shootpotato()
end

Your problem here is, You didn't Define what Potato is, so:

local sp = script.Parent

local head = sp:WaitForChild("Head")

function shootpotato()
    local potato = Instance.new("Part")
    potato.name = "Effect"
    potato.BrickColor = BrickColor.new("Bright Yellow")
    potato.Shape = "Ball"
    potato.Size = Vector3(2,2,2)
    potato.canCollide = false
    potato.CFrame = head.CFrame
    potato.Velocity = head.CFrame.lookVector*50
    potato.TopSurface = ("Smooth")
    potato.BottomSurface = ("Smooth")
    potato.Parent = game.Workspace

end

while true do
    wait(2)
    shootpotato()
end

0
It returns 07:23:05.268 - name is not a valid member of Part 07:23:05.269 - Script 'Workspace.Zombie Test.Script', Line 7 - global shootpotato 07:23:05.269 - Script 'Workspace.Zombie Test.Script', Line 22 SwiftyPeep 5 — 8y
0
oh, Because the Name property has a Capital, Put in "potato.Name = "Effect"" KenzaXI 166 — 8y

Answer this question