0
    part = script.Parent
    part.Touched:Connect(function(hit)
        local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
        plr.PlayerGui.upd.Enabled = true
    end)

that script run only once, but must run any time player touching part. Why?

4
  • Are you sure it is only running once? If you put print("Touched") inside the function, does it only print once? I think your issue might not be in this code specifically. To better help you out, could you tell us what you are trying to do, and what you are seeing happen? Commented Mar 27 at 14:19
  • I have a part. there are 2 similar scripts in it, which are activated by the same method - “touching the part”. this script should enable GUI and the other one should teleport. as soon as I run the test, the first time everything works perfectly, but in the rest of the repetitions in this session it doesn't work. And even if these 2 different codes are in 1 script. That is, both pieces of code will be executed in 1 script, but only the teleport will work. Commented Mar 27 at 16:11
  • Hi, I think it only run once because it get the player’s character, and make a GUI enabled, but I don’t think it’s getting disabled at any time, i’d recommand to make a part to disable it, and test the other part again. Hope this help ! Commented Mar 31 at 5:46
  • HI. i had a part like that what you mean. It work perfectly. Didnt work only script which turn it on Commented Mar 31 at 7:05

1 Answer 1

-1

I found the solution. I created a remote event that sent a request switch GUI to the client

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.