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'
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