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
 

Gui Pop-up Script - Help

Previous Thread :: Next Thread 
BlueBlood12 is not online. BlueBlood12
Joined: 07 Jul 2011
Total Posts: 1377
25 Nov 2013 02:27 PM
What im trying to make it do is once this part is touched by one person, everyone gets this GUI.
Any help?

gui1 = game.Lighting.CountdownSho
gui2 = game.Lighting.VoteGen

local debounce = false

function getPlayer(humanoid)
local players = game.Players:children()
for i = 1, #players do
if players[i].Character.Humanoid == humanoid then return players[i] end
end
return nil
end

function onTouch(part)

local human = part.Parent:findFirstChild("Humanoid")
if (human ~= nil) and debounce == false then

debounce = true

local player = getPlayer(human)

if (player == nil) then return end

gui1:clone().Parent = player.PlayerGui
gui2:clone().Parent = player.PlayerGui
game.Workspace.Countdown.s.Disabled = false -- Ignore this
wait(60)
game.Workspace.Countdown.s.Disabled = true -- and this
wait(35)
debounce = false
end
end

game.Workspace.VoteBox1.guifloor.Touched:connect(onTouch)
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
25 Nov 2013 02:29 PM
local players = game.Players:GetChildren()
Wouldn't that be correct?
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
25 Nov 2013 02:34 PM
local players = game.Players:children()
for i = 1, #players do

Should be

for k,c in pairs(game.Players:GetChildren()) do
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
25 Nov 2013 02:42 PM
gui1 = game.Lighting.CountdownSho
gui2 = game.Lighting.VoteGen
debounce = false
function onTouch(part)

local human = part.Parent:findFirstChild("Humanoid")
if (human ~= nil) and debounce == false then

debounce = true

for i,v in pairs(game.Players:GetPlayers()) do
gui1:clone().Parent = v.PlayerGui
gui2:clone().Parent = v.PlayerGui
game.Workspace.Countdown.s.Disabled = false -- Ignore this
wait(60)
game.Workspace.Countdown.s.Disabled = true -- and this
wait(35)
debounce = false
end
end

game.Workspace.VoteBox1.guifloor.Touched:connect(onTouch)
Report Abuse
BlueBlood12 is not online. BlueBlood12
Joined: 07 Jul 2011
Total Posts: 1377
25 Nov 2013 02:46 PM
@smiley - How would that work out though with the rest of the script? It doesnt. If you want to add that in, rewrite the rest of the script so it will work.
Report Abuse
BlueBlood12 is not online. BlueBlood12
Joined: 07 Jul 2011
Total Posts: 1377
25 Nov 2013 03:00 PM
help
Report Abuse
BlueBlood12 is not online. BlueBlood12
Joined: 07 Jul 2011
Total Posts: 1377
25 Nov 2013 03:19 PM
@smiley
Just got your second response, still wont work though
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
25 Nov 2013 03:20 PM
function getPlayer(humanoid)
local players = game.Players:children()
for i = 1, #players do
if players[i].Character.Humanoid == humanoid then return players[i] end
end
return nil
end

function onTouch(part)

local human = part.Parent:findFirstChild("Humanoid")
local character = part.Parent
local player = game.Players:GetPlayerFromCharacter(character)
if (human ~= nil) and player.PlayerGui:findFirstChild("CountDownSho") and player.PlayerGui:findFirstChild("VoteGen") then
else return
local player = getPlayer(human)

if (player == nil) then return end
gui1:clone().Parent = player.PlayerGui
gui2:clone().Parent = player.PlayerGui
game.Workspace.Countdown.s.Disabled = false -- Ignore this
wait(60)
game.Workspace.Countdown.s.Disabled = true -- and this
wait(35)
end
end

game.Workspace.VoteBox1.guifloor.Touched:connect(onTouch)
Report Abuse
BlueBlood12 is not online. BlueBlood12
Joined: 07 Jul 2011
Total Posts: 1377
25 Nov 2013 03:36 PM
any1
Report Abuse
Insainity is not online. Insainity
Joined: 01 Sep 2013
Total Posts: 3103
25 Nov 2013 03:38 PM
do

local players = game.Players:GetChildren()
Report Abuse
BlueBlood12 is not online. BlueBlood12
Joined: 07 Jul 2011
Total Posts: 1377
25 Nov 2013 03:44 PM
I did that
Report Abuse
BlueBlood12 is not online. BlueBlood12
Joined: 07 Jul 2011
Total Posts: 1377
25 Nov 2013 04:12 PM
help
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
25 Nov 2013 05:04 PM
"still wont work though"
And why not? The first part of your script is unnecessary; I've implemented it into the whole thing. Try it first and tell me why it's not working so we can fix it. My god.... -_-
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