Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

The script i use isn't working? I put it in startergui

" I need everytime the player hits the text button it goes nil and after 25 worth of seconds, it becomes true again continuously "





FightingArena = game.Players.LocalPlayer.PlayerGui.FightingArena
LocalArea1 = game.Players.LocalPlayer.PlayerGui.LocalArea1
MainPoint = game.Players.LocalPlayer.PlayerGui.Mainpoint
SafeZone = game.Players.LocalPlayer.PlayerGui.SafeZone
TradeCenter1 = game.Players.LocalPlayer.PlayerGui.TradeCenter1
Overscreen = FightingArena.Overscreen
NonScreen = LocalArea1.Nonscreen
CoverScreen = MainPoint.CoverScreen
SafeZoneB = SafeZone.SafeZoneB
Cover = TradeCenter1.Cover

function False()
	FightingArena = nil
	LocalArea1 = nil
	MainPoint = nil
	SafeZone = nil
	TradeCenter1 = nil
end

Overscreen.MouseButton1Down:connect(False)
NonScreen.MouseButton1Down:connect(False)
CoverScreen.MouseButton1Down:connect(False)
SafeZoneB.MouseButton1Down:connect(False)
Cover.MouseButton1Down:connect(False)


while true do
	if False() then
		wait(25)
		FightingArena = true
		LocalArea1 = true
		MainPoint = true
		SafeZone = true
		TradeCenter1 = true
	end
end

1 comment

0

Ignore line 38

1 answer

Here is some revised code with comments on what I changed. Only LocalScripts work in starterGui so put this code in a LocalScript.

local fa = true
FightingArena = game.Players.LocalPlayer.PlayerGui.FightingArena
LocalArea1 = game.Players.LocalPlayer.PlayerGui.LocalArea1
MainPoint = game.Players.LocalPlayer.PlayerGui.Mainpoint
SafeZone = game.Players.LocalPlayer.PlayerGui.SafeZone
TradeCenter1 = game.Players.LocalPlayer.PlayerGui.TradeCenter1
Overscreen = FightingArena.Overscreen
NonScreen = LocalArea1.Nonscreen
CoverScreen = MainPoint.CoverScreen
SafeZoneB = SafeZone.SafeZoneB
Cover = TradeCenter1.Cover

function False()
    fa = false
    FightingArena.Visible = false -- If its a frame or button you need .Visible
    LocalArea1.Visible = false
    MainPoint.Visible = false
    SafeZone.Visible = false
    TradeCenter1.Visible = false
end

Overscreen.MouseButton1Down:Connect(False()) -- These need to be False() not False
NonScreen.MouseButton1Down:Connect(False())
CoverScreen.MouseButton1Down:Connect(False())
SafeZoneB.MouseButton1Down:Connect(False())
Cover.MouseButton1Down:Connect(False())


while true do
    if fa == false then
        wait(25)
        FightingArena.Visible = false
        LocalArea1.Visible = false
        MainPoint.Visible = false
        SafeZone.Visible = false
        TradeCenter1.Visible = false
    end
    wait() -- So the while loop doesn't break the game
end

Next time please provide some more elaboration on what you are trying to do.

This discussion is preserved as it was. New answers, comments, and votes are closed.