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

Why isn't the position being set?

Asked by 6 years ago

So im trying to make a gun to my game, and it is working fine but when it came to the point to make the bullet appear and set it's position its wont work. Also i want to set its orientation to the mouse position, and also stop it at the closest object.

This is my script:

01local pistola = script.Parent
02local hole = game.StarterPack.Pistola.Hole
03local mouse = game.Players.LocalPlayer:GetMouse()
04 
05-- Lista de Valores --
06local ammo = 12
07local maxAmmo = 64
08local damage = 20
09local headshotDamage = 50
10local range = 100
11local coolDown = 1.5
12 
13-- impedir spamming --
14local spam = false
15 
View all 32 lines...

So here's a summary of my questions: -Why isn't the position being set; -How can i get the position of the mouse; -How can i set the bullet size to stop when it hits something, like a wall or a player?

Thank you for helping me (if you did helped me XD)

0
first of all, is this a local or server script? I can't really tell as you are getting the local player and setting properties of a part theking48989987 2147 — 6y
0
also, try using debris service instead of waiting then deleting theking48989987 2147 — 6y
0
It would be better to not use Debris. User#19524 175 — 6y
0
im using a local script mewant_taco 17 — 6y

Answer this question