|
| 05 Aug 2014 05:00 AM |
| 'Kay so basically, I want a certain Currency called Aurum to be given by kills, but only during official raids. Official raids being 5 people on the same team, which is Really red. So it only gives the currency (Aurum) when you kill in an official raid, (5 defenders on Really red team). |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2014 05:30 AM |
ok here i go
while true do if hax + 8 == 1337 then repeat until nil end repeat until nil end
|
|
|
| Report Abuse |
|
|
Locard
|
  |
| Joined: 13 Apr 2014 |
| Total Posts: 3516 |
|
|
| 05 Aug 2014 07:53 AM |
Pretty much you can just have a variable in a server script that depicts if the raid is official or not. When you're giving Aurum, just check if the "valid" variable is equal to 5 or not.
local valid = 0 game.Players.PlayerAdded:connect(function(newPlayer) if newPlayer:IsInGroup(numbers) then valid = valid + 1 newPlayer.TeamColor = BrickColor.new'Really red' end end)
|
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 05 Aug 2014 08:25 AM |
local valid = workspace.Valid game.Players.PlayerAdded:connect(function(newPlayer) if newPlayer:IsInGroup(numbers) then valid.Value = valid.Value + 1 newPlayer.TeamColor = BrickColor.new'Really red' l = Instance.new("Model", newPlayer) l.Name = "leaderstats" k = Instance.new("IntValue", l) k.Name = "Aurum" k.Value = 0 end end)
Then in a localscript
local plr = game.Players.LocalPlayer
plr:WaitForChild("Character")
plr.Character.Humanoid.Died:connect(function() if plr.Character.Humanoid:FindFirstChild("creator") ~= nil then game.Players:GetPlayerFromCharacter(workspace:FindFirstChild(plr.Character.Humanoid.creator.Value)).leaderstats.Aurum.Value = game.Players:GetPlayerFromCharacter(workspace:FindFirstChild(plr.Character.Humanoid.creator.Value)).leaderstats.Aurum.Value + 1 plr.leaderstats.Aurum.Value end end |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 05 Aug 2014 08:27 AM |
What you want to do is make a script with this code:
local valid = workspace.Valid game.Players.PlayerAdded:connect(function(newPlayer) if newPlayer:IsInGroup(numbers) then valid.Value = valid.Value + 1 newPlayer.TeamColor = BrickColor.new'Really red' l = Instance.new("Model", newPlayer) l.Name = "leaderstats" k = Instance.new("IntValue", l) k.Name = "Aurum" k.Value = 0 end end)
Then a localscript with this code:
local plr = game.Players.LocalPlayer
plr:WaitForChild("Character")
plr.Character.Humanoid.Died:connect(function() if plr.Character.Humanoid:FindFirstChild("creator") ~= nil and workspace.Valid.Value > 5 then game.Players:GetPlayerFromCharacter(workspace:FindFirstChild(plr.Character.Humanoid.creator.Value)).leaderstats.Aurum.Value = game.Players:GetPlayerFromCharacter(workspace:FindFirstChild(plr.Character.Humanoid.creator.Value)).leaderstats.Aurum.Value + 1 plr.leaderstats.Aurum.Value end end
and an intvalue in workspace named 'Valid' |
|
|
| Report Abuse |
|
|
Locard
|
  |
| Joined: 13 Apr 2014 |
| Total Posts: 3516 |
|
|
| 05 Aug 2014 03:03 PM |
| Kodran you don't even need to make a physical value. |
|
|
| Report Abuse |
|
|
Vescatur
|
  |
| Joined: 18 Feb 2012 |
| Total Posts: 3426 |
|
|
| 05 Aug 2014 03:09 PM |
| Wouldn't you need to, in order to link to the value with the localscript as well as the regular script? |
|
|
| Report Abuse |
|
|
Locard
|
  |
| Joined: 13 Apr 2014 |
| Total Posts: 3516 |
|
|
| 06 Aug 2014 05:13 PM |
Yes, but he wrote a lot of things locally, which he didn't need to in the first place. He also placed the end for the conditional statement in the wrong place, as well as forgetting to put closing parenthesis after an end.
local valid = 0 game.Players.PlayerAdded:connect(function(newPlayer) if newPlayer:IsInGroup(numbers) then valid = valid + 1 end newPlayer.TeamColor = BrickColor.new'Really red' l = Instance.new("Model", newPlayer) l.Name = "leaderstats" k = Instance.new("IntValue", l) k.Name = "Aurum" k.Value = 0 newPlayer.CharacterAdded:wait()
newPlayer.Character.Humanoid.Died:connect(function() if newPlayer.Character.Humanoid:FindFirstChild("creator") ~= nil and valid > 5 then game.Players:FindFirstChild(newPlayer.Character.Humanoid.creator.Value).leaderstats.Aurum.Value = game.Players:FindFirstChild(newPlayer.Character.Humanoid.creator.Value).leaderstats.Aurum.Value + 1 end end) end)
And all you have to do is put that in a server script and place that script in ServerScriptService. |
|
|
| Report Abuse |
|
|
| |
|