Noahk
|
  |
| Joined: 14 Feb 2008 |
| Total Posts: 1460 |
|
|
| 10 Apr 2012 02:16 PM |
Ever play King of the Hill by Builderman? Yeah, thats that I'm basically trying to write. I need someone to fix this. In another thread I asked, but telling me what I want to do w/ the script wont help if I can;t do it. Will someone just copy and paste the script and fix it???
function playerEnter(player) wait(.5) if game.Players.NumPlayers == 1 then player.TeamColor = BrickColor.new("Bright yellow") player.Character.Humanoid.MaxHealth = 350 player.Character.Humanoid.Health = 350 end end game.Players.PlayerAdded:connect(playerEnter)
game:GetService("Players").PlayerAdded:connect(function(playerInstance) playerInstance.CharacterAdded:connect(function(modelInstance) modelInstance.Humanoid.Died:connect(function() local objectvalueInstance = modelInstance.Humanoid:FindFirstChild("creator") if objectvalueInstance then local playerInstance = objectvalueInstance.Value if playerInstance then playername = game.Players:findFirstChild(modelInstance.Name) if playername.TeamColor == BrickColor.new("Bright yellow") then local msg = Instance.new("Message") msg.Parent = Workspace msg.Text = "".. playerInstance.Name .. " is the new dominator!" delay(3, function() msg:remove() end) playerInstance.TeamColor = BrickColor.new("Bright yellow") playerInstance.Character.Humanoid.MaxHealth = 350 playerInstance.Character.Humanoid.Health = 350 end end end end) end) end)
game:GetService("Players").PlayerAdded:connect(function(playerInstance) playerInstance.CharacterAdded:connect(function(modelInstance) modelInstance.Humanoid.Died:connect(function() playerInstance.TeamColor = BrickColor.new("Bright blue") playerInstance.Character.Humanoid.Health = 100 playerInstance.Character.Humanoid.MaxHealth = 100 end) end) end)
game.Players.PlayerRemoving:connect(function(player) msg = Instance.new("Message", Workspace) if player.TeamColor == BrickColor.new("Bright yellow") then local chosenPlayer = game.Players[math.random(1, #game.Players.GetChildren())] chosenPlayer.TeamColor = BrickColor.new("Bright yellow") msg.Text = player.Name.." has left, so ".. chosenPlayer .."Has been assigned as the new Dominator!" delay(3) msg:Remove() end end)
|
|
|
| Report Abuse |
|
|
Noahk
|
  |
| Joined: 14 Feb 2008 |
| Total Posts: 1460 |
|
| |
|
Noahk
|
  |
| Joined: 14 Feb 2008 |
| Total Posts: 1460 |
|
| |
|
setro2
|
  |
| Joined: 16 Apr 2010 |
| Total Posts: 1571 |
|
|
| 10 Apr 2012 02:49 PM |
| I don't see any prints. Add prints, and then maybe that will fix the problem. |
|
|
| Report Abuse |
|
|
setro2
|
  |
| Joined: 16 Apr 2010 |
| Total Posts: 1571 |
|
|
| 10 Apr 2012 02:50 PM |
I don't see any prints. Add prints, and then maybe that will fix the problem. If there are prints, maybe the script breaks before the script can reach the prints. |
|
|
| Report Abuse |
|
|
setro2
|
  |
| Joined: 16 Apr 2010 |
| Total Posts: 1571 |
|
|
| 10 Apr 2012 02:51 PM |
| Oh gosh. Please forgive me admins, the post button glitched, I SWEAR. |
|
|
| Report Abuse |
|
|
Noahk
|
  |
| Joined: 14 Feb 2008 |
| Total Posts: 1460 |
|
|
| 10 Apr 2012 02:52 PM |
Add prints. This is what I was talking about. I don't know what I'm doing, and you guys apparently can't even copy and paste my code to edit. |
|
|
| Report Abuse |
|
|
setro2
|
  |
| Joined: 16 Apr 2010 |
| Total Posts: 1571 |
|
|
| 10 Apr 2012 02:57 PM |
function playerEnter(player) wait(.5) if game.Players.NumPlayers == 1 then print 'NumbPlayers = 1' player.TeamColor = BrickColor.new("Bright yellow") player.Character.Humanoid.MaxHealth = 350 player.Character.Humanoid.Health = 350 print 'Numplayers = 1 lines successfully executed' end end game.Players.PlayerAdded:connect(playerEnter)
game:GetService("Players").PlayerAdded:connect(function(playerInstance) print 'Got players' playerInstance.CharacterAdded:connect(function(modelInstance) modelInstance.Humanoid.Died:connect(function() print 'A humanoid has died' local objectvalueInstance = modelInstance.Humanoid:FindFirstChild("creator") if objectvalueInstance then local playerInstance = objectvalueInstance.Value if playerInstance then playername = game.Players:findFirstChild(modelInstance.Name) print 'Successfull' if playername.TeamColor == BrickColor.new("Bright yellow") then local msg = Instance.new("Message") msg.Parent = Workspace msg.Text = "".. playerInstance.Name .. " is the new dominator!" delay(3, function() msg:remove() end) playerInstance.TeamColor = BrickColor.new("Bright yellow") playerInstance.Character.Humanoid.MaxHealth = 350 playerInstance.Character.Humanoid.Health = 350 end end end end) end) end)
game:GetService("Players").PlayerAdded:connect(function(playerInstance) print 'Got players' playerInstance.CharacterAdded:connect(function(modelInstance) modelInstance.Humanoid.Died:connect(function() playerInstance.TeamColor = BrickColor.new("Bright blue") playerInstance.Character.Humanoid.Health = 100 playerInstance.Character.Humanoid.MaxHealth = 100 end) end) end)
game.Players.PlayerRemoving:connect(function(player) msg = Instance.new("Message", Workspace) print 'New message object assigned to the name msg' if player.TeamColor == BrickColor.new("Bright yellow") then local chosenPlayer = game.Players[math.random(1, #game.Players.GetChildren())] chosenPlayer.TeamColor = BrickColor.new("Bright yellow") msg.Text = player.Name.." has left, so ".. chosenPlayer .."Has been assigned as the new Dominator!" print 'Reminded people of new dominator' delay(3) msg:Remove() print 'Removed msg' print 'Got through entire script successfully' end end)
*End of fixed script*
There, I added prints for you. :-D |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 02:58 PM |
Tell us these two things:
What you want it to do (EXACTLY). What it does (EXACTLY).
With more information, we are more able to help. |
|
|
| Report Abuse |
|
|
Noahk
|
  |
| Joined: 14 Feb 2008 |
| Total Posts: 1460 |
|
|
| 10 Apr 2012 03:02 PM |
What I want it to do: One person becomes the 'Dominator'. He gets 350 health. Kill him, you become the Dominator, he becomes a average player.
what it does: First person to enter becomes dominator, gets proper HP.
Kill him, then nobody becomes the dominator(Bright yellow team) and everyone is just an average player(bright blue).
Same thing happens in both offline server w/ 2 players and online with two different accounts.
Basically, it's a King of the Hill game. |
|
|
| Report Abuse |
|
|
Noahk
|
  |
| Joined: 14 Feb 2008 |
| Total Posts: 1460 |
|
|
| 10 Apr 2012 03:05 PM |
@Setro Last print to occur is 'New message object assigned to the name msg' |
|
|
| Report Abuse |
|
|
1WOOF1
|
  |
| Joined: 03 May 2009 |
| Total Posts: 20682 |
|
| |
|
|
| 10 Apr 2012 03:15 PM |
If only concatenation would automatically call tostring .... Stupid Lua. :D |
|
|
| Report Abuse |
|
|
Noahk
|
  |
| Joined: 14 Feb 2008 |
| Total Posts: 1460 |
|
| |
|
Noahk
|
  |
| Joined: 14 Feb 2008 |
| Total Posts: 1460 |
|
| |
|
Noahk
|
  |
| Joined: 14 Feb 2008 |
| Total Posts: 1460 |
|
| |
|
Noahk
|
  |
| Joined: 14 Feb 2008 |
| Total Posts: 1460 |
|
| |
|
brian125
|
  |
| Joined: 22 Mar 2008 |
| Total Posts: 477 |
|
|
| 10 Apr 2012 04:34 PM |
| Did you ever call the events? |
|
|
| Report Abuse |
|
|
brian125
|
  |
| Joined: 22 Mar 2008 |
| Total Posts: 477 |
|
| |
|
Noahk
|
  |
| Joined: 14 Feb 2008 |
| Total Posts: 1460 |
|
|
| 10 Apr 2012 04:34 PM |
oh my lord. That's the whole script. Kay? only weapon used is a sword. Kay? I don't know what I'm doing can someone 'call the events' for me or teach me how to??? |
|
|
| Report Abuse |
|
|
Noahk
|
  |
| Joined: 14 Feb 2008 |
| Total Posts: 1460 |
|
| |
|
1WOOF1
|
  |
| Joined: 03 May 2009 |
| Total Posts: 20682 |
|
| |
|
Noahk
|
  |
| Joined: 14 Feb 2008 |
| Total Posts: 1460 |
|
|
| 10 Apr 2012 04:47 PM |
| Yes >_> Still only puts the yellow character on blue, nobody gets put on yellow. |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2012 04:55 PM |
| Make a 'makeDominator(player)' function, and call it on the value of the creator tag of the dominator's humanoid when he dies. |
|
|
| Report Abuse |
|
|
Noahk
|
  |
| Joined: 14 Feb 2008 |
| Total Posts: 1460 |
|
|
| 10 Apr 2012 05:15 PM |
>and call it on the value of the creator tag of the dominator's humanoid when he dies.
did you not read the first few sentences of my post |
|
|
| Report Abuse |
|
|