Welcome to the Forums!
Join thousands of other Roblox members with a free account.
Create Forum Account

problem: script runs well in studio but doesnt work when visiting place

  • This website was created by Roblox members to replace the official forums (because Roblox shut them down) Join us if you like Roblox!

wolfGuardian

New Member
Reputation: 0 / 0 / 0
Feb 13, 2021
15
0
1
Roblox
neko_boi11
so i have this script that runs perfectly well in studio but when i save and update the game, then VISIT the place i just updated, it doesnt work for some freakin reason.... ugh.

Lua:
wait(5)


Instance.new("ScreenGui",game.StarterGui)

local textBOX2 = Instance.new("TextLabel",game.StarterGui.ScreenGui)

textBOX2.Visible = true

textBOX2.Text = "THE BALINSIAGAS WILL GET YOU"

textBOX2:TweenSize(UDim2.new(0,200,0,200),"Out", "Back", 1)


textBOX2:TweenPosition(UDim2.new(0,450,0,150),"Out", "Back", 1)


wait(10)

for count = 1,5,1 do
    
    wait(0.1)
    
textBOX2.Visible = false   
    
    wait(0.1)
    
textBOX2.Visible = true   
    
end

textBOX2.Visible = false

i swear editing something perfectly in studio, just to have it not work when visiting it makes wanna.... you know, so please try to reply back soon. <3
 
Solution
Your issue is that you're modifying the GUI inside StarterGui, not the one that's cloned into PlayerGui when the player's character loads. Try this in a local script parented to StarterCharacterScripts.

Lua:
local flashDelay = 5
local...

wolfGuardian

New Member
Reputation: 0 / 0 / 0
Feb 13, 2021
15
0
1
Roblox
neko_boi11
I also have a script but facing the same problem can anyone please help
ok so i figured it out: our scripts only run on the server (the screen we used to edit our games) and i guess they dont do anything to our CLIENTS (the screen where you can spawn in as a character) until we do something to the scripts i think. idk i need alot of info on this. you should look up "roblox studio servers and clients. im about to make a thread about it
 

CallMeKY

Moderator
Ultra
Reputation: 6 / 0 / 0
Feb 25, 2018
1,501
42
619
113
Maine, USA
Roblox
CallMeKY
Discord
CallMeKY#5012
Your issue is that you're modifying the GUI inside StarterGui, not the one that's cloned into PlayerGui when the player's character loads. Try this in a local script parented to StarterCharacterScripts.

Lua:
local flashDelay = 5
local flashSpeed = 0.1

local playerGui = game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui')
local screenGui = Instance.new('ScreenGui')
local textLabel = Instance.new('TextLabel', screenGui)
textLabel.Visible = false
textLabel.TextScaled = true
textLabel.AnchorPoint = Vector2.new(0.5, 0.5)
textLabel.Text = 'THE BALINSIAGAS WILL GET YOU'

local function flashGui()
    local gui = screenGui:Clone()
    local text = gui:WaitForChild('TextLabel')
    gui.Parent = playerGui
    text.Visible = true
    text:TweenSizeAndPosition(UDim2.new(0.5, 0, 0.3, 0), UDim2.new(0.5, 0, 0.5, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 1)
    wait(flashDelay)
    for _ = 1, 10 do
        wait(flashSpeed)
        text.Visible = not text.Visible
    end
    gui:Destroy()
end

wait(flashDelay)

flashGui() -- run the function with this whenever you need it to do the thing
 
  • Like
Reactions: wolfGuardian
Solution

wolfGuardian

New Member
Reputation: 0 / 0 / 0
Feb 13, 2021
15
0
1
Roblox
neko_boi11
Your issue is that you're modifying the GUI inside StarterGui, not the one that's cloned into PlayerGui when the player's character loads. Try this in a local script parented to StarterCharacterScripts.

Lua:
local flashDelay = 5
local flashSpeed = 0.1

local playerGui = game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui')
local screenGui = Instance.new('ScreenGui')
local textLabel = Instance.new('TextLabel', screenGui)
textLabel.Visible = false
textLabel.TextScaled = true
textLabel.AnchorPoint = Vector2.new(0.5, 0.5)
textLabel.Text = 'THE BALINSIAGAS WILL GET YOU'

local function flashGui()
    local gui = screenGui:Clone()
    local text = gui:WaitForChild('TextLabel')
    gui.Parent = playerGui
    text.Visible = true
    text:TweenSizeAndPosition(UDim2.new(0.5, 0, 0.3, 0), UDim2.new(0.5, 0, 0.5, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 1)
    wait(flashDelay)
    for _ = 1, 10 do
        wait(flashSpeed)
        text.Visible = not text.Visible
    end
    gui:Destroy()
end

wait(flashDelay)

flashGui() -- run the function with this whenever you need it to do the thing
i appreciate you taking the time to respond
 

Anamika

New Member
Reputation: 0 / 0 / 0
Feb 23, 2021
3
0
1
India
roblocodes.com
Roblox
AnamikaRobloxLover
I also have a script but facing the same problem can anyone please help
ok so i figured it out: our scripts only run on the server (the screen we used to edit our games) and i guess they dont do anything to our CLIENTS (the screen where you can spawn in as a character) until we do something to the scripts i think. idk i need alot of info on this. you should look up "roblox studio servers and clients. im about to make a thread about it
Thank you for your support, following for the answer