#[SOLVED] error
1 messages · Page 1 of 1 (latest)
whats under the orange
nothing
usually thats just a visual bug and it goes away after i type something
i havent had it stick around for very long
i wrote a print on it
if it stays for a while try restarting studio
i already did it
🐒
ok
i think maybe the new roblox studio theme cause it
wait
nvm
it didn't work
The error is a syntax error in the line Projectile. Velocity = (Hit-Gun.ShootPart.Position). Unit Config.Velocity.Value where Unit should be * for multiplication.
This is the corrected code
local Gun = script.Parent
local Config = Gun:FindFirstChild("Config")
local Remote = Gun:FindFirstChild("Remote")
local Pir = game:GetService("Players"):GetPlayerFromCharacter(Gun.Parent)
local IsReload = false
Remote.Fire.OnServerInvoke = function(SendPir, Hit)
if SendPir == Pir then
return
end
local Projectile = Instance.new("Part", workspace.Camera.Projectile)
Projectile.Size = Vector3.new(1, 1, 1)
Projectile.Position = Gun.ShootPart.Position
Projectile.Anchored = true
Projectile.CanCollide = false
Projectile.Material = Enum.Material.Neon
Projectile.Velocity = (Hit - Gun.ShootPart.Position).Unit * Config.Velocity.Value
end
```lua
doesn't work
i think not because of "Projectile.Velocity"
i delete "Projectile.Velocity" line before, but line 1 still get error
same thing with my other game
Check for Syntax Errors: Ensure that there are no syntax errors in your code. Sometimes a missing semicolon, bracket, or typo can cause issues.
Review Variable Declarations: Make sure that all variables are properly declared and initialized before you use them. If Projectile is a class or object, ensure it is instantiated correctly.
Look for Null References: If you're trying to access properties or methods on an object that hasn't been instantiated, you'll get a null reference error. Ensure that Projectile is not null before accessing its properties.
Check the Error Message: The error message you receive can provide valuable information about what is going wrong. Look for the line number and the type of error to help narrow down the issue.
Debugging: Use debugging tools or print statements to track the flow of your code and the values of your variables. This can help you identify where things are going wrong.
Consult Documentation: If you're using a game engine or framework, consult the documentation for the correct usage of the classes and methods you're working with.
@devout ibex
Just lmk
if u encountered any prob
i think because of the ".unit"
Ig this line is missing
lyLinearVelocity (Hit. Position Gun ShootPartPosition) Unit
```lua
It seems like the programmer intended to set the velocity based on some direction or value related to the Gun ShootPartPosition.?
it seems the issue is with the ".Unit" at the end of the line lyLinearVelocity (Hit. Position Gun ShootPartPosition) Unit
i alway use the "Velocity" one but when i update roblox studio its got an underline error and said this
nvm
the script still work with the weird error on line 1
[SOLVED] error
It’s a visual bug I have it to