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

How do i make a gui that will change when you touch a certain part in a game?

Asked by 10 years ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.

I have tried alot but it doesnt seem to work please help! Thank you

2 answers

Log in to vote
1
Answered by
Sublimus 992 Moderation Voter
10 years ago

You need to use a Touched event for when the character touches the part, and then you need to get the player from the character, then you need to modify the GUI in the PlayerGui. Put this in the part:

debounce = false
script.Parent.Touched:connect(function(hit)
    if debounce == true then return end -- Make sure it doesn't modify more than once
    debounce = true
    if hit.Parent:findFirstChild("Humanoid") then -- Make sure it's a player touching it
        player = game.Players:getPlayerFromCharacter(hit.Parent) --Finds the character
        if player ~= nil then --Just a safe-guard
            Gui = player.PlayerGui.MODIFYTHEGUISTUFFHERE -- Yeah
        end
    end
    debounce = false
end)
Ad
Log in to vote
0
Answered by 10 years ago

You need to learn the touched event. Then somehow find the Character. After that do :GetPlayerFromCharacter() THen go to the the PlayerGui and ScreenGui And TextLabel. Then change the text.

Answer this question