mattkabag
|
  |
| Joined: 13 Dec 2008 |
| Total Posts: 3156 |
|
|
| 17 Jun 2012 12:52 AM |
Can somone please help me fix this simple script?
Problem: The script works perfect on play solo but doesnt work on Play. What I mean by doesnt work means is that the GUI resets and pauses when you die
http://www.roblox.com/BLAH-item?id=83810750 |
|
|
| Report Abuse |
|
|
mattkabag
|
  |
| Joined: 13 Dec 2008 |
| Total Posts: 3156 |
|
| |
|
mattkabag
|
  |
| Joined: 13 Dec 2008 |
| Total Posts: 3156 |
|
| |
|
|
| 17 Jun 2012 12:58 AM |
| BLAH is what I said when I saw this script being a free model. |
|
|
| Report Abuse |
|
|
mattkabag
|
  |
| Joined: 13 Dec 2008 |
| Total Posts: 3156 |
|
|
| 17 Jun 2012 01:03 AM |
Script in Workspace: local OpenFor = 60 * 5--Five Minutes local ClosedFor = 60 * 3--Three Minutes local Door = game.Workspace.Door--Where the door is(the example is a brick named "Door" in workspace)
--[[Instructions]------- You have no need to change anything in this script, I programmed them to what you had requested. However, if you havent already, place the one GUI inside of this script into StarterGUI.
Changes to adjust time:
OpenFor:The time the door is open, change this(in seconds) to the amount of time it will stay open.
ClosedFor:The time the door is closed, change this(in seconds) to the amount of time it will stay closed.
Door:The location of the door by which it will be accessed. --]]--------------------
function FadeIn(Frames, Time) for i = 1, Frames do Door.Transparency = 1 - ((0.6 / Frames) * i) wait(Time) end end
function FadeOut(Frames, Time) for i = 1, Frames do Door.Transparency = ((1 / Frames) * i) wait(Time) end end
function CountedWait(Amount, Bool) script.IsOpen.Value = Bool for i = 1, Amount * 100 do wait(0.01) script.IsOpen.Time.Value = Amount - (i / 100) end end
while true do FadeOut(20, 0.1) Door.CanCollide = false CountedWait(OpenFor, true) FadeIn(20, 0.1) Door.CanCollide = true CountedWait(ClosedFor, false) end
Script in GUI: [THIS IS A LOCALSCRIPT]
local OpenValue = game.Workspace.DoorTimer.IsOpen local TimeValue = OpenValue.Time
local TextLabel = script.Parent.TextLabel local TimeLabel = script.Parent.Time
local OpenText = "The sheild will remain off for:" local CloseText = "The sheild will remain on for:"
function StatusChange(Bool) if Bool then TextLabel.Text = OpenText else TextLabel.Text = CloseText end end
function TimeChange(Value) TimeLabel.Text = Value end
OpenValue.Changed:connect(StatusChange) TimeValue.Changed:connect(TimeChange)
StatusChange(OpenValue.Value) TimeChange(TimeValue.Value) |
|
|
| Report Abuse |
|
|
mattkabag
|
  |
| Joined: 13 Dec 2008 |
| Total Posts: 3156 |
|
| |
|
| |
|
|
| 17 Jun 2012 01:34 AM |
Have you tried using the OutPut? SCRIPTER'S BEST FRIEND. (Wiki is the BESTEST friend!! (I know bestest is not a word.. e.e)) |
|
|
| Report Abuse |
|
|
mattkabag
|
  |
| Joined: 13 Dec 2008 |
| Total Posts: 3156 |
|
|
| 17 Jun 2012 01:41 AM |
| Its not free models. And theres no output. |
|
|
| Report Abuse |
|
|
|
| 17 Jun 2012 01:45 AM |
In ROBLOX Studio, open a place by using Ctrl + N. Insert your script. Click View -> Output Now, click the play button. If script has an error, it'll point it/them out and the line(s). |
|
|
| Report Abuse |
|
|
mattkabag
|
  |
| Joined: 13 Dec 2008 |
| Total Posts: 3156 |
|
|
| 17 Jun 2012 01:52 AM |
| No theres literally no output. |
|
|
| Report Abuse |
|
|
mattkabag
|
  |
| Joined: 13 Dec 2008 |
| Total Posts: 3156 |
|
| |
|
Solotaire
|
  |
| Joined: 30 Jul 2009 |
| Total Posts: 30356 |
|
|
| 17 Jun 2012 02:31 AM |
| Scripts that work in Solo mode but not Play mode are generally characterized not by an error in code, but by a lack of connections being made. Try adding "wait(1)" to the scripts on line one. |
|
|
| Report Abuse |
|
|
|
| 17 Jun 2012 02:44 AM |
I just tried this myself, TWO ERRORS! Also, this is TWO diff. scripts.. e.e FIRST SCRIPT GOES IN WORKSPACE: --Script in Workspace: local OpenFor = 60 * 5--Five Minutes local ClosedFor = 60 * 3--Three Minutes local Door = game.Workspace.Door--Where the door is(the example is a brick named "Door" in workspace)
--[[Instructions]------- You have no need to change anything in this script, I programmed them to what you had requested. However, if you havent already, place the one GUI inside of this script into StarterGUI.
Changes to adjust time:
OpenFor:The time the door is open, change this(in seconds) to the amount of time it will stay open.
ClosedFor:The time the door is closed, change this(in seconds) to the amount of time it will stay closed.
Door:The location of the door by which it will be accessed. --]]--------------------
function FadeIn(Frames, Time) for i = 1, Frames do Door.Transparency = 1 - ((0.6 / Frames) * i) wait(Time) end end
function FadeOut(Frames, Time) for i = 1, Frames do Door.Transparency = ((1 / Frames) * i) wait(Time) end end
function CountedWait(Amount, Bool) script.IsOpen.Value = Bool for i = 1, Amount * 100 do wait(0.01) script.IsOpen.Time.Value = Amount - (i / 100) end end
while true do FadeOut(20, 0.1) Door.CanCollide = false CountedWait(OpenFor, true) FadeIn(20, 0.1) Door.CanCollide = true CountedWait(ClosedFor, false) end
SECOND SCRIPT GOES INTO SOME GUI: --Script in GUI: --[THIS IS A LOCALSCRIPT]
local OpenValue = game.Workspace.DoorTimer.IsOpen local TimeValue = OpenValue.Time
local TextLabel = script.Parent.TextLabel local TimeLabel = script.Parent.Time
local OpenText = "The sheild will remain off for:" local CloseText = "The sheild will remain on for:"
function StatusChange(Bool) if Bool then TextLabel.Text = OpenText else TextLabel.Text = CloseText end end
function TimeChange(Value) TimeLabel.Text = Value end
OpenValue.Changed:connect(StatusChange) TimeValue.Changed:connect(TimeChange)
StatusChange(OpenValue.Value) TimeChange(TimeValue.Value)
I fixed all/most errors. You're welcome, if it still won't work, tell me. |
|
|
| Report Abuse |
|
|
|
| 17 Jun 2012 02:45 AM |
| *FIX* Gui goes into Second script. My mistake. |
|
|
| Report Abuse |
|
|
|
| 17 Jun 2012 02:46 AM |
| Then place script, with GUI in that, into StarterGUI, and Place the first script into workspace. |
|
|
| Report Abuse |
|
|
mattkabag
|
  |
| Joined: 13 Dec 2008 |
| Total Posts: 3156 |
|
|
| 17 Jun 2012 03:40 AM |
I already knew it was 2 different script -.- And how is it supposd to work if you gae me the same script? Also I know where the script goes in... |
|
|
| Report Abuse |
|
|
mattkabag
|
  |
| Joined: 13 Dec 2008 |
| Total Posts: 3156 |
|
| |
|
mattkabag
|
  |
| Joined: 13 Dec 2008 |
| Total Posts: 3156 |
|
| |
|
mattkabag
|
  |
| Joined: 13 Dec 2008 |
| Total Posts: 3156 |
|
| |
|
mattkabag
|
  |
| Joined: 13 Dec 2008 |
| Total Posts: 3156 |
|
|
| 17 Jun 2012 03:59 AM |
| This is soooooo frustarting that I might smash my face into the keyboard with my glasses on too... T-T |
|
|
| Report Abuse |
|
|
mattkabag
|
  |
| Joined: 13 Dec 2008 |
| Total Posts: 3156 |
|
| |
|
mattkabag
|
  |
| Joined: 13 Dec 2008 |
| Total Posts: 3156 |
|
| |
|
|
| 17 Jun 2012 04:11 AM |
OMG DID YOU NOT SEE WHERE I ADDED IN THE -- FOR THE "IN THE WORKSPACE:" PART? AND THE "IN THE GUI:" PART, ALSO THE "[LOCALSCRIPT]" PART. THAT'S WHAT WAS SCREWY. |
|
|
| Report Abuse |
|
|
|
| 17 Jun 2012 04:11 AM |
IT THOUGHT IT WAS PART OF THE SCRIPT. SO I ADDED -- TO MAKE IT NOTES. >:O |
|
|
| Report Abuse |
|
|