Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local gun = script.Parent
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local remoteEvent = ReplicatedStorage:WaitForChild('ShotEvent')
- local reload = false
- local reload_time = 1
- local player = game.Players.LocalPlayer
- gun.Equipped:Connect(function(mouse)
- player.CameraMode = Enum.CameraMode.LockFirstPerson
- mouse.Button1Down:Connect(function()
- if reload == false then
- remoteEvent:FireServer(gun.Scope.Position, mouse.Hit.p)
- reload = true
- wait(reload_time)
- reload = false
- end
- end)
- end)
- gun.Unequipped:Connect(function()
- player.CameraMode = Enum.CameraMode.Classic
- end)
Add Comment
Please, Sign In to add comment