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

How do you call a Global Function?

Asked by
Prioxis 673 Moderation Voter
10 years ago

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

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. RoboFrog 400 — 10y

Answer this question