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

I'm not sure why this fire script is not working ?

Asked by 9 years ago
Player = script.Parent.Parent
mouse = Player:GetMouse()

function onKeyDown(key)
   key = key:lower()
   if key == "z" then
      x = Instance.new("Part")
      x.BrickColor = BrickColor.new("Bright red")
      x.Size = Vector3.new(10,10,10)
      x.TopSurface = "Smooth"
      x.BottomSurface = "Smooth"
      x.Shape = "Ball"
      x.Tranparency = 0.7
      y = Instance.new("BodyVelocity")
      y.maxForce = Vector3.new(math.huge, math.huge, math.huge)
      y.Velocity = Player.Character.Torso.CFrame.lookVector*80
      x.Parent = game.Workspace
      y.Parent = x
      f = Instance.new("Fire", x)
      f.Size = 12
      f.Heat = 0
      x.Cframe = Player.Character.Torso.CFrame*CFrame.new(0, 0, -12)
      game.Debris:AddItem(x, 6)
   end
end

mouse.KeyDown:connect(onKeyDown)
0
... it would be nice if you can post some errors. Open the output window in studio. If there isn't an error, then what behavior are you expecting and what behavior are you currently getting? XAXA 1569 — 9y
0
x y f under is bule tyrellyommey123 0 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

Put local in front of the variables. Good luck!

0
THANK YOU!!!!!!!!!!!!!!!!!!!!!! tyrellyommey123 0 — 9y
0
Lol, you're welcome (: You should remember to accept my answer (: User#11440 120 — 9y
0
Just did no problem tyrellyommey123 0 — 8y
0
Wow! That was hardly a delay at all. What are you the flash? Lol, thanks bro User#11440 120 — 8y
Ad

Answer this question