Does anyone here know how to make a gun? Note that I am not using a tool and that it is a model that is welded to the players hand.
If you do know the please do tell me.
Thanks.
:D
Btw here's what I've done so far with my script
local Player = game.Players.LocalPlayer local Chara = Player.Character local Mouse = Player:GetMouse() local Reloading = false local FireEvent = script.Parent.FireEvent function Reload() if Reloading == true then print("Broke") return end Reloading = true print("Reloading") local Ammo = script.Parent.Ammo local MaxAmmo = script.Parent.MaxAmmo local Sound = script.Parent.Handle1.Reload if Ammo.Value < MaxAmmo.Value then Sound:Play() wait(0.6) Sound:Stop() wait(2) Ammo.Value = MaxAmmo.Value Sound:Play() end wait(1) Reloading = false end function Fire() local Aim = Mouse.Hit local Ammo = script.Parent.Ammo local MaxAmmo = script.Parent.MaxAmmo if Ammo.Value == 0 then Reload() return end FireEvent:FireServer(Aim) print(Aim) print("Fire") local Sound = script.Parent.Handle1.Fire Sound:Play() end Mouse.KeyDown:connect(function(Key) if Key == "r" then Reload() end end) Mouse.Button1Down:connect(function(mou) Fire() end)
Lol my comment was too big and I realized I wasn't making a seperate answer, sorry. Anyways on roblox wiki it tells you how to make a raycasting gun. You can put a number value inside the gun for ammo, guis inside the playergui, and local them INSIDE the gun script. Why don't you just use a tool? You can disable dropping and disable core GUI.