Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Making a pop-up GUI, script doesn't function properly yet no errors, why?

I've recently been working on a Z-style shooter game, and I've been having serious trouble with a pop up gui I've been trying to add. It should function if the player touches a brick, it will pop-up. As I've tried to get it to work, and searched lots of extra help online, and none of the things I've found have seemed to work. Here is my code: ~~~~~~~~~~~~~~~~~ `local Part = script.Parent

Part.Touched:connect(function(HIT) local H = HIT.Parent:FindFirstChild("Humanoid") if H then local Player = game.Players:GetPlayerFromCharacter(HIT.Parent) Player.PlayerGui.Gamepass.Frame.Visible = true end end)


As the GUI is in the Starter GUI names 'Gamepass'

1 answer

local Part = script.Parent
Part.Touched:Connect(function(HIT)  -- :connect is depreciated
local H = HIT.Parent:FindFirstChild("Humanoid") 
if H then 
local player= game:GetService("Players"):GetPlayerFromCharacter(HIT.Parent) 			player:GetService("PlayerGui").Gamepass.Frame.Visible = true 
end 
end)

I think youl code should still run the same but just try this and see if it does anything. If it doesnt then double check if humanoid is inside ur player or if you're actually touching script.Parent

2 comments

0

Thank you for your response! When the Player touches it, it doesn't show still. The character does have a humanoid inside it and it is touching the part, the script says 'running' but nothing shows!

0

Maybe check if the GUI is enabled or something thats causing it not to show up on ur screen

This discussion is preserved as it was. New answers, comments, and votes are closed.