-
What do you want to achieve? Fire remote event with proper parameters.
-
What is the issue? remote event is not even firing
-
What solutions have you tried so far? tried everything and found nothing
-- ServerScript
-- "Character" player who got stomped is "dead".
local CharPlr = game.Players:GetPlayerFromCharacter(OtherHumanoid.Parent)
if OtherHumanoid.Health <= 0 then
warn("i got it")
killedevent:FireClient(CharPlr.Name,25)
warn("I got it too")
-- Owner of tool is awarded
LocalPlayer.leaderstats.TIX.Value += 25
LocalPlayer.Stats.KillStreak.Value += 1
end
--LocalScript
game.ReplicatedStorage:WaitForChild("Events"):WaitForChild("Killed").OnClientEvent:Connect(function(name, tix)
warn("I recevied it")
tickets.Text = "You Killed: " ..name
who.Text = "You earned: " ..tix
concaten8
(Decadecimal)
#2
You need to use :FireClient() like this -
RemoteEvent:FireClient(playerInstance, arg1, arg2)
You were only firing two arguments (a name and a number, but you did not specify a Player instance as the first argument)
killedevent:FireClient(CharPlr.Name,25)
You need to find the player who killed CharPlr and do something like this:
killedevent:FireClient(playerInstanceWhoKilled, CharPlr.Name, 25)
In the code example provided, you are missing an end) on your OnClientEvent callback:
game.ReplicatedStorage:WaitForChild("Events"):WaitForChild("Killed").OnClientEvent:Connect(function(name, tix)
warn("I received it")
tickets.Text = "You killed: "..name
who.Text = "You earned: "..tix
end) -- look here
Also please pay attention to the way you indent your code ^_^’
Hope this points you in the right direction.
1 Like