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:
local player = game.Players.LocalPlayer local char = player.Character if(char.Torso.Position - game.Workspace.Part.Position).Magnitude <= 10 then print("Character is 10 or less studs away from part") end
What you can do is just set parts in certain points and create onTouched function to get the GUI to pop up
Example:
GUI = game.Players.LocalPlayer.PlayerGui.GUINAME script.Parent.Touched:connect(function() if GUI.Visible == false then GUI.Visible =true wait(5) GUI.Visible = false end 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 :)