Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

This script works in testing but not in the real game? Maybe it starts too early?

Asked by 6 years ago

I know this is a common question, but I'm just wondering if anyone knows an easy way to fix this. This is the script:

local seconds = script.Parent
local prefix = script.Value.Value
script.Parent.Parent.Text = prefix.." "..seconds.Value

for i = 1,seconds.Value do
    wait(1)
    seconds.Value = seconds.Value - 1
    script.Parent.Parent.Text = prefix.." "..seconds.Value
end

script.Parent.Parent:TweenPosition(UDim2.new(0.379, 0, -0.3, 0), "Out", "Quad", 1)

It works fine in testing but not in the real game. I'm wondering if it doesn't work because it begins before everything has loaded in?

0
Is the game FE? Sergiomontani10 236 — 6y
0
and are you using a localscript or script Sergiomontani10 236 — 6y
0
Have you tried pressing F9 in-game? Tymberlejk 143 — 6y
0
Yes filtering is enabled R2D2yodayolo 32 — 6y
0
It's in a script, not local. and what would pressing f9 do that just opens the output? R2D2yodayolo 32 — 6y

3 answers

Log in to vote
0
Answered by 6 years ago

You need to show me the variables please.

0
The first variable is a IntValue, the second variable is the value of a StringValue R2D2yodayolo 32 — 6y
0
this should be a comment fanofpixels 718 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

Yeah, I kind of need to see the variables, but from what I see, make everything :WaitForChild("Name of child"). That way it will actually find the child. Example

local Seconds = script.Parent.Parent:WaitForChild(" whatever the name of variable")
local prefix1 = script:WaitForChild("Value")
local prefix = prefix1.Value
Log in to vote
0
Answered by 6 years ago

Based from what I heard, you are using Filtering Enabled you MUST use local scripts in GUI's while using Filtering Enabled. Since Local script are client sided and server scripts are server sided. Filtering Enabled This will help you know what the limits are. Just put it in a local script and you can use Remote Events to make it be able to do changes to the server.

Answer this question