Ad
Log in to vote
0

I write a function that works but I rewrite with a different gui and nothing happens?

Asked by 7 years ago

Mario Logo and NintendoToSega does not work! PLEASE HELP!

wait(1) player = game.Players.LocalPlayer button = script.Parent

function teleportToArena() torso = player.Character.Torso torso.CFrame = game.Workspace.MarioTP.CFrame end

button.MouseButton1Click:connect(teleportToArena)

local MarioChar = player.PlayerGui.ChooseCharacter.MarioChar

function onClick()
    if MarioChar.Visible then
        MarioChar.Visible = false
    end
end

button.MouseButton1Click:connect(onClick)

player = game.Players.LocalPlayer

local ChooseCharacter = player.PlayerGui.ChooseCharacter.ChooseCharacter

function onClick2() if ChooseCharacter.Visible then ChooseCharacter.Visible = false end end

button.MouseButton1Click:connect(onClick2)

local MarioName = player.PlayerGui.ChooseCharacter.MarioName

function onClick3() if MarioName.Visible then MarioName.Visible = false end end

button.MouseButton1Click:connect(onClick3)

local NintendoToSega = game.StarterGui.ChooseCharacter.NintendoToSega

function onClick4() if NintendoToSega.Visible then NintendoToSega.Visible = false end end

button.MouseButton1Click:connect(onClick4)

local MarioName = game.StarterGui.ChooseCharacter.MarioName

function onClick5()
    if MarioName.Visible then
        MarioName.Visible = false
    end
end

button.MouseButton1Down:connect(onClick5)

local MarioLogo = game.StarterGui.ChooseCharacter.MarioLogo

function onClick6()
    if MarioLogo.Visible then 
        MarioLogo.Visible = false
    end
end

button.MouseButton1Down:connect(onClick6)

1
Please edit your post to correct the Lua formatting. BlueTaslem 18066 — 7y
0
how exactly? ILikepie2100 20 — 7y
0
ok got it ILikepie2100 20 — 7y

1 answer

Log in to vote
1
Answered by
Shawnyg 4300 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
7 years ago

It's a bit annoying to see that all of your lines aren't in Lua formatting, but by looking, I found a simple mistake. You keep adding the StarterGui. It won't change what's happening on the Player's screen (unless you add a script to do that). I recommend making it a LocalScript, and accessing the PlayerGui by game.Players.LocalPlayer.PlayerGui. If you put all of your lines into Lua format, I'll be able to be more of service. Any questions? Be sure to comment.

0
OMG THANKS SO MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!! ILikepie2100 20 — 7y
0
Glad I could help! Shawnyg 4300 — 7y
Ad

Answer this question