I made a few global functions in a ServerScript in the workspace

Here's my script with the functions :

_G["Blink"] = function()
	local gui = game.Players.LocalPlayer.PlayerGui
wait(0.1)
gui.CutScene.Frame.BackgroundTransparency = 0.7
wait(0.1)
gui.CutScene.Frame.BackgroundTransparency = 0.5
wait(0.1)
gui.CutScene.Frame.BackgroundTransparency = 0.3
wait(0.1)
gui.CutScene.Frame.BackgroundTransparency = 0.1
wait(0.1)
gui.CutScene.Frame.BackgroundTransparency = 0
wait(0.1)
gui.CutScene.Frame.BackgroundTransparency = 0.1
wait(0.1)
gui.CutScene.Frame.BackgroundTransparency = 0.3
wait(0.1)
gui.CutScene.Frame.BackgroundTransparency = 0.5
wait(0.1)
gui.CutScene.Frame.BackgroundTransparency = 0.7
wait(0.1)
gui.CutScene.Frame.BackgroundTransparency = 1
end

_G["Sleep"] = function()
local gui = game.Players.LocalPlayer.PlayerGui
gui.CutScene.Text.Visible = true
gui.CutScene.Text.Text = "Goodnight Everybody..."
wait(1)
gui.CutScene.Text.Text = ""
gui.CutScene.Text.Visible = false
wait(0.1)
gui.CutScene.Frame.BackgroundTransparency = 0.7
wait(0.1)
gui.CutScene.Frame.BackgroundTransparency = 0.5
wait(0.1)
gui.CutScene.Frame.BackgroundTransparency = 0.3
wait(0.1)
gui.CutScene.Frame.BackgroundTransparency = 0.1
wait(0.1)
gui.CutScene.Frame.BackgroundTransparency = 0
end

and heres the way i'm calling them

	_G.Sleep()

It works in play solo but I think everything works in Play solo but online it doesn't work

1 comment

0

Have you tried ModuleScripts? I personally can't help with your provided script, but I know that ModuleScripts will allow you to call other functions in other scripts.