generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Not getting output, Please help!

Previous Thread :: Next Thread 
Noahk is not online. 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 is not online. Noahk
Joined: 14 Feb 2008
Total Posts: 1460
10 Apr 2012 02:28 PM
please
Report Abuse
Noahk is not online. Noahk
Joined: 14 Feb 2008
Total Posts: 1460
10 Apr 2012 02:42 PM
I seriously need help.
Report Abuse
setro2 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
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 is not online. 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 is not online. 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 is not online. 1WOOF1
Joined: 03 May 2009
Total Posts: 20682
10 Apr 2012 03:07 PM
[ Content Deleted ]
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
10 Apr 2012 03:15 PM
If only concatenation would automatically call tostring ....
Stupid Lua. :D
Report Abuse
Noahk is not online. Noahk
Joined: 14 Feb 2008
Total Posts: 1460
10 Apr 2012 03:35 PM
Uhh, can someone fix it?
Report Abuse
Noahk is not online. Noahk
Joined: 14 Feb 2008
Total Posts: 1460
10 Apr 2012 04:01 PM
Anyone? Is it even fixed?
Report Abuse
Noahk is not online. Noahk
Joined: 14 Feb 2008
Total Posts: 1460
10 Apr 2012 04:19 PM
help please
Report Abuse
Noahk is not online. Noahk
Joined: 14 Feb 2008
Total Posts: 1460
10 Apr 2012 04:33 PM
bump

Report Abuse
brian125 is not online. brian125
Joined: 22 Mar 2008
Total Posts: 477
10 Apr 2012 04:34 PM
Did you ever call the events?
Report Abuse
brian125 is not online. brian125
Joined: 22 Mar 2008
Total Posts: 477
10 Apr 2012 04:34 PM
oh wait, nevermind
Report Abuse
Noahk is not online. 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 is not online. Noahk
Joined: 14 Feb 2008
Total Posts: 1460
10 Apr 2012 04:41 PM
bump again
Report Abuse
1WOOF1 is not online. 1WOOF1
Joined: 03 May 2009
Total Posts: 20682
10 Apr 2012 04:46 PM
[ Content Deleted ]
Report Abuse
Noahk is not online. 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
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image