What do you want to achieve? Can i have script laser sight like video under, i try to making game and weapons for sniper but it request laser sight work for sniper trainee, please?
Request to answer like this:
Script
Place it on where?
I want script it work inside tool.
It’s script or local script?
That script only work when use tool and it can follow mouse.
Tell me step by step to make it.
That script will request certain position on weapon to enable laser sight like video.
That laser sight can see from another people.
If you can, send me a map it have this script and tool to test too, thank you (Sorry if I bad Grammar)
I know it but many players have a bad aim when without a laser, I need it for my game, cause at the night Sniper can’t see their aim dot to get a headshot, mainly on high ground or in the forest to shoot the enemy, laser sight it help them fire target jump well than when without laser sight, I have trying to find good script laser sight and add inside the tool, it works a bit but it has a lot of bugs.
Then you obviously don’t know. This requires scripting, it’s not something someone will give you for free on the toolbox that magically works with all guns. I’ll hint you to it- get the player’s mouse with game.Players.LocalPlayer:GetMouse(). The mouse has a .Hit property, which is a raycast to the mouse in 3D space. You can do Mouse.Hit.Position to get where it landed, and in a RunService.RenderStepped event, set the laser’s attachment WorldPosition to Mouse.Hit.Position.
I will provide an example, but it’s best you read the text above as your use case may vary. Note that this does not replicate to other players, use a remote event for that (make sure it has a cooldown to prevent lag, though).
local RunService = game:GetService('RunService')
local Mouse = game:GetService('Players').LocalPlayer:GetMouse()
local Attachment = nil
-- Alternatively, you can use Mouse.Move or UserInputService.InputBegan,
-- ... which may fix lag on the server or client
RunService.RenderStepped:Connect(function()
if attachment then
attachment.WorldPosition = Mouse.Hit.Position
end
end)