I have tried alot but it doesnt seem to work please help! Thank you
COMMUNITY QUESTION
How do i make a gui that will change when you touch a certain part in a game?
2 answers
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)
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.
