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

Not shooting out?

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

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.

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

2 comments

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

0

oh, Because the Name property has a Capital, Put in "potato.Name = "Effect""

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