|
| 21 Oct 2017 12:31 PM |
how to add xp to my leaderstats when zombie dies? i tired to do when i hit the zombie its saving my name in string value in the zombie and when his hp == 0 fire server or fire client add xp to player it didnt work
should the script that when zombie have 0 be a local script or normal script? |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2017 12:32 PM |
x = leaderstats Value
x.Value = x.Value+1 |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2017 12:34 PM |
Did this for a project a while back
game.workspace.ChildAdded:Connect(function(child) if child.Name == "Zombie" then local Humanoid = child:WaitForChild("Humanoid") Humanoid.Died:Connect(function() if Humanoid:FindFirstChild("creator") ~= nil then local Killer = Humanoid.creator.Value Killer.leaderstats.Cash.Value = Killer.leaderstats.Cash.Value + 20 end end) end end) |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2017 12:35 PM |
| ?????? i know that but im trying to do it filter enabled |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2017 12:37 PM |
i wrote it to ReallyExpensive thanks McRocketNuggets i will try it |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2017 01:23 PM |
| thanks i used Humanoid.Died:Connect(function() instead of if humanoid.Health == 0 its worked :D |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2017 04:41 PM |
| why its work in studio but when i publish its not working? please help |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2017 04:49 PM |
| Did you place my code inside of a server sided script? |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2017 04:58 PM |
| i put it inside the zombie in folder in workspace |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2017 05:03 PM |
| Put my script inside "ServerScriptService" |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2017 05:25 PM |
| ok i put it there but its work only in studio |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 22 Oct 2017 01:58 PM |
| soomeone please help me why its works in studio and not when i publish it |
|
|
| Report Abuse |
|
|