Okay so basically i'm doing an Amaterasu script and it is for FE ,but when i get to the CFrame part it doesn't work
--local script
local deez = game.ReplicatedStorage.MyRemoteEvent
local Player = game.Players.LocalPlayer--find player
local Character = Player.Character
local debounce = true
local Mouse = Player:GetMouse()
function relay()
local hit = Mouse.hit.p
local userInputService = game:GetService("UserInputService")
userInputService.InputBegan:connect(function(input, processed)
if Character.Head.Texture == "http://www.roblox.com/asset/?id=108227137" then
if input.KeyCode == Enum.KeyCode.Z then
if debounce == true then
debounce = false
deez:FireServer("hit")
wait(15)
debounce = true
end
end
end
end)
end
--script
local deez = game.ReplicatedStorage.MyRemoteEvent
deez.OnServerEvent:connect(function(player, hit)
local character = player.Character
local z = Instance.new("Part")
z.Parent = game.Workspace
z.Name = "bb"
z.CFrame = hit
z.Transparency = 1
z.Size = Vector3.new(5.81, 0.66, 7.65)
local x = Instance.new("ParticleEmitter",game.Workspace.bb)
x.VelocitySpread = 50
x.Rate = 50
local transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,0.5,0),NumberSequenceKeypoint.new(1,0.5,0)})
game.Workspace.bb.ParticleEmitter.Transparency = transparency
x.Color = ColorSequence.new(Color3.new(0/0,0/0,0/0))
x.Texture = "rbxgameasset://Images/b4d1cbee17f898243017bed18c835cff"
x.Size = NumberSequence.new(5)
wait(5)
z:remove()
print(hit)
end)
The error is at the line Z.CFrame = hit but i can't figure out how to fix it. This is the output
Workspace.Player1.Amaterasu:8: bad argument #3 to 'CFrame' (CFrame expected, got nil)
Thanks in Advance. Yours Sincerely far.

1 comment
I agree with @AstreaDev . You are carrying over the string "hit" into the place of the parameter hit in your OnServerEvent. You can't get a CFrame from a string which is why it is printing nil. You can use the first parameter "player" for their CFrame or carry the players CFrame over.