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

CFrame is nil while trying to make a lookvector appearance, and i dont know why??

Asked by 2 years ago

Im trying to make a effect appear and i use cframe in order to do the look vector, but for some reason i keep getting " attempt to index nil with 'CFrame' "

local fireball  = game:GetService("ReplicatedStorage").SP2.Fireball
local ball = game:GetService("ReplicatedStorage").SP2.Ball
local swirl = game:GetService("ReplicatedStorage").SP2.SwirlShockwaveFire
local ground = game:GetService("ReplicatedStorage").SP2.DestroyedGround

local TweenService = game:GetService("TweenService")
local tweenInfo1 = TweenInfo.new(0.5,Enum.EasingStyle.Back,Enum.EasingDirection.InOut, 0,false,0)
local tweenInfo2 = TweenInfo.new(2,Enum.EasingStyle.Back,Enum.EasingDirection.InOut, 0,false,0)

local remote = script.Parent.Parent.Events.Fire
local tool = script.Parent.Parent
local JP = 7.2
local WS = 16

local TouchedConnection


remote.OnServerEvent:Connect(function(plr)
    local HRP = plr.Character.HumanoidRootPart
    local Glow1 = game.ReplicatedStorage.SP2.YellowGlow.Glow:Clone()

    Glow1.Parent = plr.Character["Right Arm"]
    Glow1.Position = plr.Character["Right Arm"].Position

    HRP.Parent.Humanoid.JumpHeight = 0
    HRP.Parent.Humanoid.WalkSpeed = 0

    local char = tool.Parent
    local player = game.Players:GetPlayerFromCharacter(char)
    local hum = char:FindFirstChild("Humanoid")
    local humrp = char:FindFirstChild("HumanoidRootPart")

    local Effects =  game.ServerStorage.FireStartUp:Clone()
    Effects.Parent = workspace
    Effects.CFrame = humrp.CFrame + humrp.CFrame.LookVector*3
    game.Debris:AddItem(Effects,1)


Answer this question