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

How to make a Gui Button change overhead text?

Asked by 2 years ago
Edited 2 years ago

I want to make a gui button, so whenever you press it, it changes your overhead gui.

(divisionpart is the overhead gui and one of the text lines)

game.StarterGui.StartFrame.Image1.MouseButton1Click:Connect(function() divisionpart.Text = "Sword Divsion" end)

That is the script I currently have.

1 answer

Log in to vote
0
Answered by
Xapelize 2658 Moderation Voter Community Moderator
2 years ago
Edited 2 years ago
game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui").StartFrame.Image1.MouseButton1Click:Connect(function()
    divisionpart.Text = "Sword Division"
end)

First, let's talk about "Server" and "Client"

Server is the place where they handle normal scripts, and no exploiter can access to "Server", so a lot of codes are limited at "Server" since no exploiter can access them!

Server is not a player, and what it sees is "StarterGui", if you change anything in the "StarterGui" while playing in server, no one will see the change until respawn!

And client is a player, which is everyone in the server, each player is a client, client can exploit, but only they can see the change that they exploited, but with some coding (we won't talk about what is it since this is a beginner tutorial) we can exploit the game on the "Server"! (don't do it)

Client is a player... so what "it" sees is PlayerGui, which you need to change PlayerGui to work

Hope this helped:)

(if you followed a tutorial for that script, it's most likely outdated, their game had FilteringEnabled on, which changing StarterGui things will also replicate to PlayerGui)

0
This wasnt from a tutorial.. I am trying to run it on server so everyone can see it once the player made the action Lmfaodarkness 0 — 2y
0
But I'll change the PlayerGui Lmfaodarkness 0 — 2y
Ad

Answer this question