GUI = game.ReplicatedStorage.Radar.radar
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)
if Player == game.Players.LocalPlayer then
game.PlayerGui.Radar.radar.Visible = true
-- Radar is a screen GUI
-- radar is a frame
end
end
end)?
COMMUNITY QUESTION
Gui not appearing when brick touched?
3 answers
Okay, I'm pretty sure this will work, but fix your GetPlayerFromCharacter() to look like this:
local Player = game.Players:GetPlayerFromCharacter(HIT.Parent.Name)
3 comments
0
Im sorry, but this doesn't work either. I am really stumped here.
0
The GetPlayerFromCharacter() isn't working for me too. Maybe somethings wrong with it.
0
GetPlayerFromCharacter() requires an object, not a string
script.Parent.Touched:connect(function(hit)
if hit.Parent.Humanoid then
local Character = hit.Parent
local Player = game.Players:GetPlayerFromCharacter(Character)
local PlayerGui = Player.PlayerGui
local Gui = PlayerGui.Radar
local Frame = Gui.radar
Frame.Visible = true
end
end
Hope this helps
If your trying to make a Frame visible then just access the PlayerGui;
Make sure this is a script, not local script
local part = script.Parent
part.Touched:Connect(function(H)
local pg = H.Parent:WaitForChild("PlayerGui")
local frame = pg:WaitForChild("Radar").radar
wait()
radar.Visible = true
end)
You don't need some stuff,
if this helped please accept answer :D
2 comments
0
PlayerGui is a child of the player, not the Character (H.Parent).
0
This script doesn't work.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
This is in a local script BTW