Eventive
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 9827 |
|
|
| 05 Feb 2017 09:46 AM |
script.Parent.Handle.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local damage = 20 hit.Parent.Humanoid:TakeDamage(damage) wait(1) end end)
LocalScript inside a tool. The tool eventually gets cloned into a players backpack. How would I make this work with FE?
ATR'er since 2013. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 05 Feb 2017 09:48 AM |
Change it to a server script
|
|
|
| Report Abuse |
|
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
| |
|
Eventive
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 9827 |
|
|
| 05 Feb 2017 10:14 AM |
That made my friends health go to 0 for me but not for him, and he didn't die.
ATR'er since 2013. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 05 Feb 2017 10:16 AM |
That doesn't seem right. Any errors?
Since its fe the script has to be in a server script. I do not think you need to use remote events for this. I'm not sure what else is missing here.
|
|
|
| Report Abuse |
|
|
|
| 05 Feb 2017 10:18 AM |
make a remote event used to damage people server side, BUT also keep the damage code locally, so the player sees an immediate reaction to hitting them
|
|
|
| Report Abuse |
|
|
|
| 05 Feb 2017 10:19 AM |
something like this
Event.OnServerEvent:connect(function(Player, Humanoid, Damage) Humanoid:TakeDamage(Damage) end)
|
|
|
| Report Abuse |
|
|
Eventive
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 9827 |
|
|
| 05 Feb 2017 10:22 AM |
RemoteEvent named KillEvent in ReplicatedStorage in a Folder called NetworkFolder
Local Script: local RE = game:GetService("ReplicatedStorage"):WaitForChild("NetworkFolder"):WaitForChild("KillEvent")
RE.OnServerEvent:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local damage = 20 hit.Parent.Humanoid:TakeDamage(damage) wait(1) end end)
Server Script inside the tool along with the local script local RE = game:GetService("ReplicatedStorage"):WaitForChild("NetworkFolder"):WaitForChild("KillEvent")
script.Parent.Handle.Touched:connect(function(player, hit) RE:FireClient(player, hit) end)
ATR'er since 2013. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 05 Feb 2017 10:23 AM |
@OP @Luna
Like I said, you DO NOT need a remote event to do this since it's already in a server script.
|
|
|
| Report Abuse |
|
|
Eventive
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 9827 |
|
|
| 05 Feb 2017 10:25 AM |
Time, When I put it into a Serverscript, it lowered the health to 0 but didn't kill at all, but my friends health showed as 100 for him and 0 for me. Therefore it's ClientSided and needs a RemoteEvent
ATR'er since 2013. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 05 Feb 2017 10:26 AM |
LOL.
"Server script"
"Client sided"
Alright. I see the logic flaw in there but ok. You do your way. Good luck buddy.
|
|
|
| Report Abuse |
|
|
|
| 05 Feb 2017 10:27 AM |
@TimeTicks i dont think you read my post
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 05 Feb 2017 10:28 AM |
@Luna
I don't think you understand how FE works.
|
|
|
| Report Abuse |
|
|
|
| 05 Feb 2017 10:29 AM |
pretty sure i understand how FE works
|
|
|
| Report Abuse |
|
|
Exzeption
|
  |
| Joined: 01 Nov 2011 |
| Total Posts: 1312 |
|
|
| 05 Feb 2017 10:29 AM |
eventive you have to use a script not a localscript
~The Low Brass Master |
|
|
| Report Abuse |
|
|
Eventive
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 9827 |
|
|
| 05 Feb 2017 10:30 AM |
TimeTicks, It doesn't make sense to me, but that's what happened.
ATR'er since 2013. |
|
|
| Report Abuse |
|
|
Eventive
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 9827 |
|
|
| 05 Feb 2017 10:36 AM |
I apologize for my ignorance,
I must've done something wrong, but it works. Sorry.
ATR'er since 2013. |
|
|
| Report Abuse |
|
|