Local bullet_clone = ServerStorage.Bullet:Clone()īullet_clone.Size = Vector3.new(0.1, 0.1, distance)īullet_clone.CFrame = CFrame.new(origin, intersection)*CFrame.new(0, 0, -distance/2) Local distance = (origin - intersection).Magnitude Local intersection = result and result.Position or origin + direction Local result = Workspace:Raycast(origin, direction) Local direction = (position - origin).Unit*300 Remote.OnServerEvent:Connect(function(player, position) Local ServerStorage = game:GetService("ServerStorage") Local Workspace = game:GetService("Workspace") Local remote = tool:WaitForChild("OnShoot") Local shoot_part = tool:WaitForChild("Handle") Server Script: local tool = script.Parent My gun will not make a bullet to where the mouse if pointing (sometimes), but let me know what you guys think. Hey developers, I made a custom gun script, and I want to check what you guys think.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |