I am not afraid of fixing anything in scripting but raycasting. I’m trying to make the raycast to check if the fireball is on the ground or not. But even though it is it still wont fire the function.
Please help me. Here’s the code:
local poss = fireball.Position
local e = -((poss-(Vector3.new(poss.X,game.Workspace.Baseplate.Position.Y,poss.Z)+Vector3.new(0,game.Workspace.Baseplate.Size.Y/2,0))).Magnitude)
if workspace:Raycast(poss,Vector3.new(0,-1,0)) then
lightstrike(poss+Vector3.new(0,e,0))
end