So recently i had a setup to see if a target was hit and where it was hit at specifically. my method to do this was name the different sections of targets with numbers 10, 20 , 30 , 50 , 100 and if tonumber(part.Name) then anchor it. to have it stick to the target. sadly what ends up happening is the game calculates where it would hit and just kinda leaves it floating mid flight.
any ideas?
script.Parent.Touched:Connect(function(target)
print(target)
if tonumber(target.Name) then
game.ServerScriptService.ModificationsStats.Points.Value = tonumber(target.Name)
script.Parent.Material = Enum.Material.Neon
script.Parent.BrickColor = BrickColor.new("Institutional white")
wait()
script.Parent.Anchored = true
end
end)
wait()
script.Parent.BodyVelocity:Destroy()
wait(5)
script.Parent:Destroy()
it literally calculates as a touch only a few studs after it leaves the barrel. and i know it is because its printing the name of the target part it touches
no part in the game’s name is a number automatically a name is a string if i am able to covert that string to a number then tonumber() is = to true and not nil.
that’s way to complicated for the current setup. because the target board can be set further by the player to get more points. and still kinda unreliable since of delay, ive been looking into this network ownership thing.