I'm making batman!
And I want the player to be able to grapple to some specific bricks when they get close enough to them by pressing a button. Think the grapple mechanic in the Arkham games, but more limited.
I want to have an indicator GUI appear when a player is in range of a brick they can grapple onto which will point them to the direction of the brick and demonstrate where it is--again, think Arkham. How would I do that?
In a LocalScript in StarterGui:
1 | local player = game.Players.LocalPlayer |
2 | local char = player.Character |
3 | if (char.Torso.Position - game.Workspace.Part.Position).Magnitude < = 10 then |
4 | print ( "Character is 10 or less studs away from part" ) |
5 | end |
What you can do is just set parts in certain points and create onTouched function to get the GUI to pop up
Example:
1 | GUI = game.Players.LocalPlayer.PlayerGui.GUINAME |
2 |
3 | script.Parent.Touched:connect( function () |
4 | if GUI.Visible = = false then |
5 | GUI.Visible = true |
6 | wait( 5 ) |
7 | GUI.Visible = false |
8 | end |
9 | end ) |
This was done on a phone so it is not sorted with tabs but instead sorted with spaces please rearrange the code
Please be Sure to ACCEPT this answer :)