Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I add crosshairs to my game?

I am currently creating a first person shooter game. I have a first person script and a movement speed script (I want it to be fast paced) but I have no clue on how to add crosshairs. I want them to stay in the middle of the screen and I don't want the ordinary mouse pointer to be in the way. Also I would like to be able to choose my own image for the crosshair (if at all possible).

2 answers

The easiest way to achieve a desirable effect is to use a GUI to make the crosshairs, since this is in first person after all, and set the mouse cursor to a blank image, such as this one (Note that that is a ROBLOX Image, not a Decal).

In a LocalScript:

game.Players.LocalPlayer:GetMouse().Icon = "http://www.roblox.com/asset/?id=22416261"

5 comments

0

Okay so I got the normal cursor to disappear (thanks to your script) but now how would I go about setting my own image to be the new crosshair?

0

You'll have to create a centered GUI for that. There are quite a few tutorials on the Wiki for that, or you could take one from Free Models.

0

I'm actually having an issue now with the blank crosshair script you gave me. It only works like once then it stops working. It only works when I am on studio mode and click test but when I go click play on the game it doesn't work anymore.

0

LocalScript are weird. Try adding a wait(1) to the start of it.

0

Or 'repeat wait() until game.Players.LocalPlayer'

what i do is make a frame then size it, duplicate it, then rotate it 90 degrees so it gets a perfectly in the middle. also i have to make sure the mouse isn't visible

This discussion is preserved as it was. New answers, comments, and votes are closed.