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 11 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
11 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:

01debounce = false
02script.Parent.Touched:connect(function(hit)
03    if debounce == true then return end -- Make sure it doesn't modify more than once
04    debounce = true
05    if hit.Parent:findFirstChild("Humanoid") then -- Make sure it's a player touching it
06        player = game.Players:getPlayerFromCharacter(hit.Parent) --Finds the character
07        if player ~= nil then --Just a safe-guard
08            Gui = player.PlayerGui.MODIFYTHEGUISTUFFHERE -- Yeah
09        end
10    end
11    debounce = false
12end)
Ad
Log in to vote
0
Answered by 11 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