Hi fellow devs! I’ve recently been to make a genjutsu attack (pretty much put multiple people in an illusion) but I’m having a bit of an issue, my script works like this, it fires a remove event to the server when the key “G” is pressed and then from the server it will use magnitude to get everyone in a 25 stud radius and then send another remove event to FireAllClients(v) and then I make it print v in the local script that picked up all the clients in the stud radius and it even prints me, heres my scripts:
Server Script that picks up the UserInputService Event:
script.Parent.OnServerEvent:Connect(function(plr)
print(plr)
local char = plr.Character
local root = char.HumanoidRootPart
local hum = char.Humanoid
for i,v in pairs(workspace:GetChildren()) do
if v:IsA("Model") and v:FindFirstChild("Humanoid") and v:FindFirstChild("HumanoidRootPart") then
if v ~= char then
if (root.Position - v.HumanoidRootPart.Position).Magnitude <25 then
script.GenjutsuEvent:FireAllClients(v)
print(v)
script.GenjutsuEvent.Owner.Value = (char.Name)
end
end
end
end
end)
Local Script that gets all the clients:
script.Parent.OnClientEvent:Connect(function(plr)
if plr ~=script.Parent.Owner.Value then
print(plr)
workspace.CurrentCamera.CameraSubject = workspace.Partz
end
end)
Any help would be very appreciated and to everyone reading this, I hope you have a great day! ;D