so im making a marking system where when you hit a player with an attack it places a mark above their head, I want it to be where only the attacker can see the marks so I’m using FireClient but for some reason it won’t even work, it’s not even saying anything in the output.
game.ReplicatedStorage.AbilityEvent.OnClientEvent:Connect(function(plr, hit, Argument)
print("Sent")
if Argument == "mark" then
print("Marked")
if hit.Parent.Head:FindFirstChild("StringMarkers") then
local children = hit.Parent.Head:FindFirstChild("StringMarkers"):GetChildren()
local count = #children
if count < 4 then
local marker = game.ReplicatedStorage["PuppetMaster Files"].Marker:Clone()
marker.Parent = hit.Parent.Head.StringMarkers
end
else
local markers = game.ReplicatedStorage["PuppetMaster Files"].StringMarkers:Clone()
markers.Parent = hit.Parent.Head
local marker = game.ReplicatedStorage["PuppetMaster Files"].Marker:Clone()
marker.Parent = hit.Parent.Head.StringMarkers
end
end
end)
so I got it to send but it won’t add the mark
Server
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local AbilityEvent = ReplicatedStorage:WaitForChild("AbilityEvent")
game.ReplicatedStorage.AbilityEvent:FireClient(plr, hit, "mark")
Client
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local AbilityEvent = ReplicatedStorage:WaitForChild("AbilityEvent")
game.ReplicatedStorage.AbilityEvent.OnClientEvent:Connect(function(plr, hit, Argument)
print("Sent")
if Argument == "mark" then
print("Marked")
if hit.Parent.Head:FindFirstChild("StringMarkers") then
local children = hit.Parent.Head:FindFirstChild("StringMarkers"):GetChildren()
local count = #children
if count < 4 then
local marker = game.ReplicatedStorage["PuppetMaster Files"].Marker:Clone()
marker.Parent = hit.Parent.Head.StringMarkers
end
else
local markers = game.ReplicatedStorage["PuppetMaster Files"].StringMarkers:Clone()
markers.Parent = hit.Parent.Head
local marker = game.ReplicatedStorage["PuppetMaster Files"].Marker:Clone()
marker.Parent = hit.Parent.Head.StringMarkers
end
end
end)
This might sound outright crazy but print your Argument variable and see what it returns before your if Argument and utilize tostring() for your argument, this may or may not work. Roblox can be odd sometimes.