Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I add crosshairs to my game?

Asked by 9 years ago

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

Log in to vote
2
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
9 years ago

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"
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? captiongoosebut 19 — 9y
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. adark 5487 — 9y
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. captiongoosebut 19 — 9y
0
LocalScript are weird. Try adding a `wait(1)` to the start of it. adark 5487 — 9y
0
Or 'repeat wait() until game.Players.LocalPlayer' Redbullusa 1580 — 9y
Ad
Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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

Answer this question