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