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: Script help

Previous Thread :: Next Thread 
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
20 Sep 2014 12:26 PM

part = game.Workspace.hi
h=game.StarterGui.ScreenGui.Frame.Timer
timer=30

ding = game.Workspace.ding

while wait(1) and timer > 0 do
timer=timer -1
h.Text="INTERMISSION "..timer..""
timerthing = coroutine.create(function()
for _,v in pairs(game.Players:GetPlayers()) do
local PlayerGui = v:findFirstChild("PlayerGui")
PlayerGui.ScreenGui.Frame.Timer.Text = ""..h.Text..""
end
end)
if timer == 0 then
p = ding:Clone()
ding:Destroy()
p.Parent = game.Players.LocalPlayer.Character.Head
p:Play()
h.Text="CHOOSING MAP!"
timerthing = coroutine.create(function()
for _,v in pairs(game.Players:GetPlayers()) do
local PlayerGui = v:findFirstChild("PlayerGui")
PlayerGui.ScreenGui.Frame.Timer.Text = ""..h.Text..""
end
end)
wait(1)
game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(Vector3(part.Position))

end
end

For some reason you cant see the timer change in the players playergui, I have been trying to fix this for days, can someone help me?
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
20 Sep 2014 12:27 PM
whoops, forgot this


part = game.Workspace.hi
h=game.StarterGui.ScreenGui.Frame.Timer
timer=30

ding = game.Workspace.ding

while wait(1) and timer > 0 do
timer=timer -1
h.Text="INTERMISSION "..timer..""
timerthing = coroutine.create(function()
for _,v in pairs(game.Players:GetPlayers()) do
local PlayerGui = v:findFirstChild("PlayerGui")
PlayerGui.ScreenGui.Frame.Timer.Text = ""..h.Text..""
end
end)
if timer == 0 then
p = ding:Clone()
ding:Destroy()
p.Parent = game.Players.LocalPlayer.Character.Head
p:Play()
h.Text="CHOOSING MAP!"
timerthin = coroutine.create(function()
for _,v in pairs(game.Players:GetPlayers()) do
local PlayerGui = v:findFirstChild("PlayerGui")
PlayerGui.ScreenGui.Frame.Timer.Text = ""..h.Text..""
end
end)
wait(1)
game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(Vector3(part.Position))

end
end
timerthing()
timerthin()

there we go
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
20 Sep 2014 12:32 PM
b1
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
20 Sep 2014 12:35 PM
bump.
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
20 Sep 2014 12:39 PM
bump1
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
20 Sep 2014 02:34 PM
bump
Report Abuse
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
20 Sep 2014 02:38 PM
Coroutines are ran with the resume function, unless you use coroutine.wrap then you call it like this


coroutine.resume(functionName)
Report Abuse
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
20 Sep 2014 02:40 PM
Personnaly I like to bind these 2

coroutine.resume(coroutine.create(function()
--Code
end))

-- this runs instantly
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
20 Sep 2014 02:58 PM
Now when ever the player leaves and rejoins the timer starts over. Can I fix this by adding a player added function in the coroutine?
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
20 Sep 2014 03:05 PM
bump
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
20 Sep 2014 03:16 PM
bump
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
20 Sep 2014 03:26 PM
bump
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
20 Sep 2014 03:32 PM
Bumpy
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
20 Sep 2014 03:45 PM
Someone respond!!
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
20 Sep 2014 03:52 PM
The OP is so needy.

Well then make a timer module. Why not try to fix it yourself?
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
20 Sep 2014 03:55 PM
Thats what im trying to do.. and nothing is working -.-
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
20 Sep 2014 04:08 PM
Well instead of doing a procedural approach, try the OOP approach.

local Timer = {}
Timer.new = function(amount)
local this = {}
this.Cur_Time = 0
this.Time = amount
this.reset = function(self, amt)
self.Time = amt
self.Cur_time = 0
end
this.isTime = function(self)
return self.Cur_Time >= self.Time
end
this.tick = function(self, amt)
self.Cur_Time = self.Cur_Time + amt
wait(amt)
end
return this
end

local Tiempo = Timer.new(5)

while true do
Tiempo:tick(0.3)
print "Hello"
if(Tiempo:isTime())then
break
end
end

print "Finito"
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
20 Sep 2014 08:09 PM

part = game.Workspace.hi
h=game.StarterGui.ScreenGui.Frame.Timer
timer=30

ding = game.Workspace.ding

while wait(1) and timer > 0 do
timer=timer -1
h.Text="INTERMISSION "..timer..""
timn = coroutine.resume(coroutine.create(function()
for _,v in pairs(game.Players:GetPlayers()) do
PlayerGui = v:findFirstChild("PlayerGui")
PlayerGui.ScreenGui.Frame.Timer.Text = ""..h.Text..""
end
end))

if timer == 0 then
p = ding:Clone()
ding:Destroy()
p.Parent = game.Players.LocalPlayer.Character.Head
p:Play()
h.Text="CHOOSING MAP!"
tim = coroutine.resume(coroutine.create(function()
for _,v in pairs(game.Players:GetPlayers()) do
PlayerGui = v:findFirstChild("PlayerGui")
PlayerGui.ScreenGui.Frame.Timer.Text = ""..h.Text..""
end
end))
wait(5)


end
end
timn()
tim()


For some reason the time isnt the same for everyone,so one players tim is 17 and the others might be 9 or something? How would i fix this?
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
21 Sep 2014 12:25 PM
BUMP
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
22 Sep 2014 04:04 PM
This is what I have now


part = game.Workspace.hi
h=game.StarterGui.ScreenGui.Frame.Timer
timer=30

ding = game.Workspace.ding

while wait(1) and timer > 0 do
timer=timer -1
h.Text="INTERMISSION "..timer..""
timn = coroutine.resume(coroutine.create(function()
for i,v in pairs(game.Players:GetPlayers()) do
PlayerGui = v:findFirstChild("PlayerGui")
i = PlayerGui.ScreenGui.Frame.Timer.Text == ""..h.Text..""
end
end))
end

if timer == 0 then
p = ding:Clone()
ding:Destroy()
p.Parent = game.Players.LocalPlayer.Character.Head
p:Play()
h.Text="CHOOSING MAP!"
tim = coroutine.resume(coroutine.create(function()
for i,v in pairs(game.Players:GetPlayers()) do
PlayerGui = v:findFirstChild("PlayerGui")
i = PlayerGui.ScreenGui.Frame.Timer.Text == ""..h.Text..""
end
end))
end

wait(5)


timn()
tim()


but now the timer wont go in player gui can someone help!
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
22 Sep 2014 04:15 PM
bump
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
22 Sep 2014 04:22 PM
Can someone answer!
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
22 Sep 2014 04:39 PM
It has been 2 days no answer...
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
22 Sep 2014 07:01 PM
BUMP
Report Abuse
theGOLDENidol is not online. theGOLDENidol
Joined: 11 Apr 2011
Total Posts: 787
22 Sep 2014 07:11 PM
BuMp
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