Every time i run the script in roblox studio it says attempt to index global "Tool" (a nil value") Can you guys help me Thank you! Heres the script
OUT=false;
SATTACKING=false
SBeast=Instance.new("Part")
SBeast.TopSurface=0
SBeast.BottomSurface=0
SBeast.Anchored=true
SBeast.Name="Ogawa"
SBeast.Size=Vector3.new(3,3,3)
SBeast.BrickColor=BrickColor.new("Really black")
m=Tool.JawMesh:clone()
m.Parent=SBeast
m.Scale=Vector3.new(2,2,2.5)
sbct=0
game:GetService("RunService").Stepped:connect(function()
local s=SBeast
if s.Parent~=nil then
local fow=.6
local pos1=SBeast.CFrame*CFrame.new(0,0,-fow)
local pos2=SBeast.CFrame*CFrame.new(0,0,-50)
SBeast.CFrame=CFrame.new(pos1.p,pos2.p)
sbct=sbct+1
if sbct==4 then
sbct=0
local p=Instance.new("Part")
p.TopSurface=0
p.BottomSurface=0
p.CanCollide=false
p.Anchored=true
p.BrickColor=BrickColor.new("Really black")
p.formFactor="Symmetric"
p.Size=Vector3.new(1,1,1)
p.CFrame=s.CFrame*CFrame.new(0,0,-1)
p.Parent=Tool
local m=Instance.new("BlockMesh")
m.Parent=p
m.Scale=Vector3.new(3,3,3)
coroutine.resume(coroutine.create(function(p) for i=1, 18 do p.Mesh.Scale=p.Mesh.Scale-Vector3.new(3/18,3/18,3/18) p.CFrame=p.CFrame*CFrame.fromEulerAnglesXYZ(math.random(-10,10)/20,math.random(-10,10)/20,math.random(-10,10)/20)+SBeast.CFrame.lookVector*-.2 wait() end p.Parent=nil end),p)
end
end
end)

1 comment
You didn't define what Tool is (line 10).