game.ReplicatedStorage.CallWarn.OnServerEvent:Connect(function(a,p) local s = game.ServerStorage:WaitForChild("warning") local r = s:Clone() r.Parent = game.Workspace:WaitForChild(p).Head r.fg.Text = "Warning 1. Reason: "..a p.WarningCount = p.WarningCount + 1 wait(5) r:Destroy() end)
event run code:
game.ReplicatedStorage.CallWarn:FireServer("MissingBoshjio","res")
My comment is saying to do this..
game.ReplicatedStorage.CallWarn.OnServerEvent:Connect(function(player,a,p) local s = game.ServerStorage:WaitForChild("warning") local r = s:Clone() r.Parent = game.Workspace:WaitForChild(p).Head r.fg.Text = "Warning 1. Reason: "..a p.WarningCount = p.WarningCount + 1 wait(5) r:Destroy() end)
Then you could use the player parameter(and get its character) instead of referencing the workspace.