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

Why does it say when i test the script Cframe is not available?

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

function onKeyDown(key)
   key = key:lower()
   if key == "z" then
      local 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.Transparency = 0.8
      local 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
      local f = Instance.new("Fire", x)
      f.Size = 15
      f.Heat = 0
      x.Cframe = Player.Character.Torso.CFrame*CFrame.new(0, 0, -10)
      game.Debris:AddItem(x, 6)
   end
end

mouse.KeyDown:connect(onKeyDown)


1 answer

Log in to vote
1
Answered by
sad_eyez 162
8 years ago

On this line it looks like you forgot to capitalize:

x.Cframe = Player.Character.Torso.CFrame*CFrame.new(0, 0, -10)

Should Be:

x.CFrame = Player.Character.Torso.CFrame*CFrame.new(0, 0, -10)

Capitalization is very important

0
Thank you :) tyrellyommey123 0 — 8y
Ad

Answer this question