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

How to get the script to find the player's gui?

Asked by 6 years ago

So I have a gui which starts up dialogue, however, when you get a certain badge, the dialogue will change. This has worked in the past but because of filtering enabled, it has stopped working. Here is the script -

badge = game:GetService("BadgeService")
if badge:UserHasBadge(script.Parent.Parent.Parent.Parent.Parent.userId,910407501) then
script.Parent.Text = "Thanks a ton! <3"
script.Parent.Parent.Button1.Visible = false
script.Parent.Parent.Button2.Text = "Close Dialog"
end

So the script basically detects whether the dialogue should change depending if the user has the badge, but like stated, it does not work. The gui is located in the ReplicatedStorage and the script itself is found in a button in the gui. It works in studio as it is going through the player's stats, but does not work in an actual server. Thanks =^)

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

You don't. You need RemoteEvents for the client to do it.

0
Mind elaborating? Skepticlemon 24 — 6y
Ad

Answer this question