01 | GUI = game.ReplicatedStorage.Radar.radar |
02 | local Part = script.Parent |
03 |
04 | Part.Touched:connect( function (HIT) |
05 | local H = HIT.Parent:FindFirstChild( "Humanoid" ) |
06 | if H then |
07 | local Player = game.Players:GetPlayerFromCharacter(HIT.Parent) |
08 | if Player = = game.Players.LocalPlayer then |
09 | game.PlayerGui.Radar.radar.Visible = true |
10 | -- Radar is a screen GUI |
11 | -- radar is a frame |
12 | end |
13 | end |
14 | end )? |
Okay, I'm pretty sure this will work, but fix your GetPlayerFromCharacter() to look like this:
1 | local Player = game.Players:GetPlayerFromCharacter(HIT.Parent.Name) |
01 | script.Parent.Touched:connect( function (hit) |
02 | if hit.Parent.Humanoid then |
03 | local Character = hit.Parent |
04 | local Player = game.Players:GetPlayerFromCharacter(Character) |
05 | local PlayerGui = Player.PlayerGui |
06 | local Gui = PlayerGui.Radar |
07 | local Frame = Gui.radar |
08 | Frame.Visible = true |
09 | end |
10 | 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
1 | local part = script.Parent |
2 |
3 | part.Touched:Connect( function (H) |
4 | local pg = H.Parent:WaitForChild( "PlayerGui" ) |
5 | local frame = pg:WaitForChild( "Radar" ).radar |
6 | wait() |
7 | radar.Visible = true |
8 | end ) |
You don't need some stuff,
if this helped please accept answer :D