|
| 16 Aug 2015 06:03 PM |
timer = game.StarterGui.timer.Frame.TextLabel plr = game.Players.LocalPlayer if timer.Text == "10" then print('timer finished.. starting game') game.ServerStorage.tool:clone().Parent = plr.Backpack end
I don't see any errors in the output I've been trying to fix the problem for two days |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Aug 2015 06:08 PM |
First I needa know a few stuff: - What are you trying to do? - In what way does it not work?
But if I had to guess, it's because you don't have anything repeatedly calling that code. Prolly need an event or a loop or something. |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 06:12 PM |
Adding a loop didn't fix it when the timer reaches 10 it puts a tool in your inventory |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 16 Aug 2015 06:15 PM |
you need to edit the playergui not startergui.
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Aug 2015 06:16 PM |
If the provided code is really all the relevant code you have than the problem IS that you're only running it once.
What you just did is basically if I'm picking up cookies one by one. You ask me if I have 10 cookies I'm like rofl no I'd eventually get 10 cookies and maybe more but you didn't ask me again so you wouldn't know that I did. |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 06:18 PM |
| @TimeTicks, still won't work.. |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 06:19 PM |
I added a while true do loop and a wait at the before end didnt work |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 06:21 PM |
What does your script look like now? Were there any errors?
|
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 06:25 PM |
@ScrewDeath no
I tried RemoteEvents but this wont work.. x = 0 while true do x = x + 1 script.Parent.TextLabel.Text = x if x == 10 then warn('timer: 10') game.Workspace.StartGame:FireClient() break else warn("timer: "..x) end wait(0.5) end I get an error saying that the argument on line 8 is missing or nil |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 06:26 PM |
it looked like this..
plr = game.Players.LocalPlayer timer = plr.PlayerGui.timer.Frame.TextLabel
while true do if timer.Text == "10" then print('timer finished.. starting game') game.ServerStorage.Flashlight:clone().Parent = plr.Backpack end wait() end |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 16 Aug 2015 06:26 PM |
script.Parent.TextLabel.Changed:connect(function() if script.Parent.TextLabel.Text == "10" then --stuff end end)
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 06:29 PM |
@TimeTicks still wont work.. maybe its not how I check it.. |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 06:34 PM |
plr = game.Players.LocalPlayer timer = plr.PlayerGui.timer.Frame.TextLabel
timer.Changed:connect(function() print('okay') if timer.Text == "10" then print('timer finished.. starting game') game.ServerStorage.Flashlight:clone().Parent = plr.Backpack end end)
It's not printing 'okay' which means the timer.Changed won't work |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Aug 2015 07:09 PM |
A) Is the code in a LocalScript? B) Is the LocalScript in a place inside the Player? |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 08:18 PM |
| @EmsyThorne, A is yes because I'm not stupid.. and B is a no |
|
|
| Report Abuse |
|
|