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

Gui.visible = true OnTouch help me?

Asked by 9 years ago

function onTouch(Part) wait(1) game.StarterGui.ScreenGui.Frame.Visible = true wait(1) end script.Parent.Touched:connect(onTouch)

please help me With this

0
This mistake is made over and over again, take a look at my answer to this question: https://scriptinghelpers.org/questions/23870/text-change-on-tool-equip Perci1 4988 — 9y

1 answer

Log in to vote
2
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
9 years ago

Changing things in StarterGui will not change anything else. You will see the changes when you die and the elements of StarterGui are copied back into your PlayerGui. Instead of changing what is given to you when you respawn, change what you actually have already.

script.Parent.Touched:connect(function(Part)
    local player=game.Players:GetPlayerFromCharacter(Part.Parent)
    if player then
        wait(1)
        player:WaitForChild("PlayerGui"):WaitForChild("ScreenGui"):WaitForChild("Frame").Visible=true
        wait(1)
    end
end)
Ad

Answer this question