FireAllClient() Not working

FireAllClients() doesn’t work on startup, tried searching the web

Server Script:
–Service
local UserInputService = game:GetService(“UserInputService”)
local TweenService = game:GetService(“TweenService”)
local Debris = game:GetService(“Debris”)
local rp = game:WaitForChild(“ReplicatedStorage”)
local events = rp:WaitForChild(“Events”)
local event = events:WaitForChild(“FireTornado”)

local model = rp:WaitForChild(“FireTornado”)
local Hitbox = script.Hitbox

local function BurnTornado(player)
local Character = player.Character
local CF1 = Character.HumanoidRootPart.CFrameCFrame.new(0,0,-2)
local CF2 = Character.HumanoidRootPart.CFrame
CFrame.new(-4,0,-2)
local CF3 = Character.HumanoidRootPart.CFrame*CFrame.new(4,0,-2)

local Pos1 = Character.HumanoidRootPart.CFrame*CFrame.new(0,0,-200).Position
local Pos2 = Character.HumanoidRootPart.CFrame*CFrame.new(0,0,-200).Position
local Pos3 = Character.HumanoidRootPart.CFrame*CFrame.new(0,0,-200).Position

local NewHitbox1 = Hitbox:Clone()
NewHitbox1.CFrame = CF1
NewHitbox1.Parent = workspace

local NewHitbox2 = Hitbox:Clone()
NewHitbox2.CFrame = CF2
NewHitbox2.Orientation = Vector3.new(0,30,0)
NewHitbox2.Parent = workspace

local NewHitbox3 = Hitbox:Clone()
NewHitbox3.CFrame = CF3
NewHitbox3.Orientation = Vector3.new(0,-30,0)
NewHitbox3.Parent = workspace

local function VFX(CF1,CF2,CF3, Pos1,Pos2,Pos3)
	local FireTornadoVFX1 = model:Clone()
	FireTornadoVFX1.CFrame = CF1
	FireTornadoVFX1.Parent = workspace
	
	local FireTornadoVFX2 = model:Clone()
	FireTornadoVFX2.CFrame = CF2
	FireTornadoVFX2.Orientation = Vector3.new(0,30,0)
	FireTornadoVFX2.Parent = workspace
	
	local FireTornadoVFX3 = model:Clone()
	FireTornadoVFX3.CFrame = CF3
	FireTornadoVFX3.Orientation = Vector3.new(0,-30,0)
	FireTornadoVFX3.Parent = workspace
	
	Debris:AddItem(FireTornadoVFX1, 2)
	Debris:AddItem(FireTornadoVFX1, 2)
	Debris:AddItem(FireTornadoVFX1, 2)
end
event:FireAllClients(VFX)

end
event.OnServerEvent:Connect(BurnTornado)

Client script:
– Service
local UserInputService = game:GetService(“UserInputService”)
local events = game.ReplicatedStorage:WaitForChild(“Events”)
local rp = game:WaitForChild(“ReplicatedStorage”)
local TweenService = game:GetService(“TweenService”)

local event = events:WaitForChild(“FireTornado”)
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

local Debounce = false

local function Detect(input, GameProcessed)
if GameProcessed then return end

if input.KeyCode == Enum.KeyCode.T then
	event:FireServer(mouse.hit.p)
	print("Activated!")

	Debounce = true
	wait(5)
	Debounce = false
end

end

UserInputService.InputBegan:Connect(Detect)

From what I see, there’s no OnClientEvent in the client portion, the way you’re trying to do it wont work, VFX needs to be the function of an OnClientEvent which then you FireAllClients to make it run.

You will need to include model in the client portion as well as VFX uses it so you wont error when trying to FireAllClients with the change I mentioned of putting it in an OnClientEvent


I did not understand a little, please do not ignore after my message, I’m just a newbie in this

Basically, as you did OnServerEvent in a script, you have to do an OnClientEvent in a local script for FireAllClients to do something, the function of it should be the VFX function

event.OnClientEvent:Connect(function(CF1,CF2,CF3, Pos1,Pos2,Pos3) 
	local FireTornadoVFX1 = model:Clone()
	FireTornadoVFX1.CFrame = CF1
	FireTornadoVFX1.Parent = workspace
	
	local FireTornadoVFX2 = model:Clone()
	FireTornadoVFX2.CFrame = CF2
	FireTornadoVFX2.Orientation = Vector3.new(0,30,0)
	FireTornadoVFX2.Parent = workspace
	
	local FireTornadoVFX3 = model:Clone()
	FireTornadoVFX3.CFrame = CF3
	FireTornadoVFX3.Orientation = Vector3.new(0,-30,0)
	FireTornadoVFX3.Parent = workspace
	
	Debris:AddItem(FireTornadoVFX1, 2)
	Debris:AddItem(FireTornadoVFX1, 2)
	Debris:AddItem(FireTornadoVFX1, 2)
end)

Or you can put it separate and then pass it to the Connect as you did for the OnServerEvent

And then the FireAllClients passes the required parameters,

event:FireAllClients(CF1, CF2, CF3, Pos1, Pos2, Pos3)

Thanks you ! It’s Working[quote=“EmbatTheHybrid, post:4, topic:1825300, full:true”]
Basically, as you did OnServerEvent in a script, you have to do an OnClientEvent in a local script for FireAllClients to do something, the function of it should be the VFX function

event.OnClientEvent:Connect(function(CF1,CF2,CF3, Pos1,Pos2,Pos3) 
	local FireTornadoVFX1 = model:Clone()
	FireTornadoVFX1.CFrame = CF1
	FireTornadoVFX1.Parent = workspace
	
	local FireTornadoVFX2 = model:Clone()
	FireTornadoVFX2.CFrame = CF2
	FireTornadoVFX2.Orientation = Vector3.new(0,30,0)
	FireTornadoVFX2.Parent = workspace
	
	local FireTornadoVFX3 = model:Clone()
	FireTornadoVFX3.CFrame = CF3
	FireTornadoVFX3.Orientation = Vector3.new(0,-30,0)
	FireTornadoVFX3.Parent = workspace
	
	Debris:AddItem(FireTornadoVFX1, 2)
	Debris:AddItem(FireTornadoVFX1, 2)
	Debris:AddItem(FireTornadoVFX1, 2)
end)

Or you can put it separate and then pass it to the Connect as you did for the OnServerEvent

And then the FireAllClients passes the required parameters,

event:FireAllClients(CF1, CF2, CF3, Pos1, Pos2, Pos3)

[/quote]

THX , it’s working

1 Like