Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[SOLVED] Remote Event doesn't fire after being fired from a local script?

Asked by 3 years ago
Edited by imKirda 3 years ago

I've made an remote event to kill the player once it's fired and it doesn't work. I will provide local script and server script beneath because I am done with this. I will also use --To show where it doesn't work

Server script:

01function Critical(player)
02  while true do
03    wait(0.1)
04    if player.Character.LimbStatus.HeadDamaged.Value == 2 or player.Character.LimbStatus.TorsoDamaged.Value == 2 then --Probably has to do something with this
05      workspace[player.Name].Humanoid:TakeDamage(100)
06    end
07 
08  end
09end
10 
11game.ReplicatedStorage.Events.Death.OnServerEvent:Connect(Critical)

Now the Local script:

01wait(3)
02local Player = game.Players.LocalPlayer
03local Char = Player.Character
04local Hum = Char:FindFirstChild("Humanoid")
05 
06local LeftLeg = game.Players.LocalPlayer.Character:FindFirstChild("Left Leg").LeftLegLimb
07local RightLeg = game.Players.LocalPlayer.Character:FindFirstChild("Right Leg").RightLegLimb
08local Head =  game.Players.LocalPlayer.Character:FindFirstChild("Head").HeadLimb
09local Torso = game.Players.LocalPlayer.Character:FindFirstChild("Torso").TorsoLimb
10 
11while true do
12  wait(0.1)
13  if LeftLeg.Value < 1 then
14    Hum.WalkSpeed = 8
15    Hum.JumpHeight = 1
View all 43 lines...
0
are there errors in the output? And how exactly do you know that the event is not firing, did you test it with prints? imKirda 4491 — 3y
0
Is there any errors? Maybe because you have to do WaitForChild on the remoteevent in the server script. AProgrammR 398 — 3y
0
There's not any errors in the output. I just changed a bit on the script and now it completely doesn't do anything KeyGua2_0 6 — 3y
0
I fixed it, holy I just changed a bit of the code and now it works perfectly KeyGua2_0 6 — 3y
View all comments (2 more)
1
Still thank you guys for the help! KeyGua2_0 6 — 3y
0
@AProgrammR i can tell you something about WaitForChild if you want -> dm in bio imKirda 4491 — 3y

Answer this question