#random beams in shotgun

1 messages · Page 1 of 1 (latest)

charred raft
#

im making easy ray gun system. when i trying to fire with shotgun it makes beams in random directions. spread does not work in shotgun mode. scripts in comments

charred raft
#
    local bullet = Instance.new("Part")
    local direction = (endpos - starpos).unit
    local ray = Ray.new(starpos, direction * dist)
    local hit, pos = workspace:FindPartOnRay(ray)
    if not pos then
        pos = endpos
    end
    bullet.Size = Vector3.new(0.1, 0.1, dist)
    bullet.CFrame = CFrame.new(starpos, pos)
    bullet.CFrame = bullet.CFrame * CFrame.new(0, 0, -dist / 2)
    bullet.Material = Enum.Material.Neon
    bullet.CanCollide = false
    bullet.BrickColor = BrickColor.new("White")
    bullet.Transparency = 0.5
    bullet.Parent = workspace
    local transparency_tween = game:GetService("TweenService"):Create(bullet, TweenInfo.new(0.1), {Transparency = 1})
    transparency_tween:Play()
    game.Debris:AddItem(bullet, 0.1)
    if hit then
        local humanoid = hit.Parent:FindFirstChildOfClass("Humanoid")
        if humanoid then
            if hit.Parent.Name ~= player.Name then
                if hit.Name == "Head" then
                    humanoid:TakeDamage(dmg * headshot)
                else
                    humanoid:TakeDamage(dmg)
                end
            end  
        end
    end
end)```
#

server

dim hill
#

spread usually happens on angles instead of an offset of the hitpos since distance from the origin to the hitpos will change how much spread there is. that's where i would start

charred raft
dim hill
charred raft
#

when it enabled it does not work at all, the rays going straight. and sometimes couple of rays goes in random direction

#

when it disabled nothing changes

dim hill
# dim hill spread usually happens on angles instead of an offset of the hitpos since distan...

i like saying things just for the sake of saying things when responding to someone's question, y'know i just enjoy stringing random words together, like here's another random string of words that is absolutely not related to anything at all whatsoever: "use angles to do bullet spread instead of a random offset from the hitpos for the second time". saying stuff for the sake of saying stuff is fun Thumbs

charred raft
#

i don't understand

#

how position and angles can be combined

#

or what i should do

dim hill
#

let me literally draw you a picture

charred raft
#

hmm

#

what i should do

#

like

dim hill
#

use the correct method

charred raft
#

but how realise that

dim hill
# charred raft but how realise that

how you "realise" that? uh, idk, google's ai defines "how to realise" as:

To "realise" something, whether it's an idea, a goal, or a potential, requires setting clear goals, taking action, and persevering through challenges

charred raft
#

oh

#

realize*

dim hill
#

ai gave another one

To "realize" something means to become aware of or understand a situation, sometimes suddenly, or to achieve something you planned to do or hoped for

#

idk how you "do" that exactly, you just kinda do it?

wheat cradle
dim hill
#

To realize something, whether a goal, an understanding, or a potential, requires a combination of reflection, action, and a growth mindset. Think about your experiences, set clear goals, and take small, consistent steps towards them.

charred raft
#

im using translator

#

sorry

wheat cradle
#

understandable

charred raft
#

implement

#

embody

#

actualize

dim hill
dim hill
charred raft
#

i will know

wheat cradle
dim hill
charred raft
# dim hill this will probably point you in the right direction https://create.roblox.com/do...
    local bullet = Instance.new("Part")
    local direction = (endpos - starpos).unit
    local ray = Ray.new(starpos, direction * dist)
    local hit, pos = workspace:FindPartOnRay(ray)
    if not pos then
        pos = endpos
    end
    bullet.Size = Vector3.new(0.1, 0.1, dist)
    local bulletCFrame = CFrame.new(starpos, pos)
    bullet.CFrame = bulletCFrame * CFrame.new(0, 0, -dist / 2)
    bullet.Material = Enum.Material.Neon
    bullet.CanCollide = false
    bullet.BrickColor = BrickColor.new("White")
    bullet.Transparency = 0.5
    bullet.Parent = workspace
    local transparency_tween = game:GetService("TweenService"):Create(bullet, TweenInfo.new(0.1), {Transparency = 1})
    transparency_tween:Play()
    game.Debris:AddItem(bullet, 0.1)
    if hit then
        local humanoid = hit.Parent:FindFirstChildOfClass("Humanoid")
        if humanoid then
            if hit.Parent.Name ~= player.Name then
                if hit.Name == "Head" then
                    humanoid:TakeDamage(dmg * headshot)
                else
                    humanoid:TakeDamage(dmg)
                end
            end  
        end
    end
end)```
dim hill
#

starpos, endpos,

#

should be starpos, direction

#

and then the server checks where the ray hits

#

you already have half of it at the top lua local direction = (endpos - starpos).unit local ray = Ray.new(starpos, direction * dist) local hit, pos = workspace:FindPartOnRay(ray)

#

just send the direction instead of endpos

charred raft
#

okay

dim hill
# charred raft without spread

ye u doing some crazy stuff, add prints, do at least even the most remote super beginner newbie braindead debugging steps and i'm sure you can figure out more than "it not work plz halp!"

#

you're not more braindead than a super beginner newbie braindead skiddie are you? surely you can take some basic debugging steps?

charred raft
#

i’ve tried

#

when i checked mouse positions, it worked perfectly on client

#

but randomly on server it breaks

dim hill
#

asplain it to me like i dont know code at all

charred raft
dim hill
#

(that helps more than you think, just trust the process 👍 )

charred raft
#

print(pos)

dim hill
charred raft
#

well

#

on cilent it works perfect

dim hill
#

where is print(angle)?

charred raft
dim hill
#

but also where is print(hitted_pos)?

charred raft
#

well

dim hill
charred raft
#

твоя помощь как говна лопату

dim hill
dim hill
#

good luck doing this yourself skid

#

fuckin' russian skids

charred raft
dim hill
#

go back to your.. na you aint worth it

charred raft
#

why you deleted a message

#

🤨

dim hill
#

man, back in my day, 99% of ruskidskies were hackers/exploiters, i banned so many of them it's crazy

#

but oh how the times change

dim hill
#

still skids, better ai-generated hacks... still zero skill. how sad

#

an entire continent with less than a skibbidi of skill. lol

#

i dont need to waste my time on this, and neither does anyone else.

#

still nice to know roblox's slaughter of russian skiddies still reels to this day. go back to your cave, ruskie.

#

the world don't need more russian hackers. skid.

#

@charred raft иди сосать лох мингликер

charred raft
#

братан считает что каждый второй читер, я могу тоже самое сказать, американцы это быдло которое при любой возможности начинают тебя засирать за национальность без вязкой на то причины, тебе такое будет приятно?

charred raft
wheat cradle
#

y'all just stop

charred raft
wheat cradle
#

Stop talking to eachother

#

Doesnt matter

dim hill
charred raft
wheat cradle
#

Theres no use just arguing

#

just stop

dim hill
#

if you want to help this skiddie hacker be their guest salute

charred raft
wheat cradle
#

All im trying rn is to get you guys to stop talking to eachother

dim hill
#

either that or they are disrespectul, it's always one of the 2

charred raft
#

я промолчу

dim hill
charred raft
dim hill
#

i would hope this kid learns a lesson of respect but, yea, not a chance of that. they're set in their ruskidie ways.

dim hill
#

anyway i'ma head off before some ruskie wastes any more of my time. peace ☮️

charred raft
#

какой респект, ты меня обосрал с ног до головы как мол я тупой и не могу понять какой то простой ошибки, а ему еще и уважение нужно, и ты же так хотел уйти отсюда, че не уходишь?

charred raft
#

аргументации маловастенько

dim hill
#

no one cares

wheat cradle
#

@quaint ember @coarse cradle @runic maple can someone calm this down?

dim hill
# wheat cradle <@834489773573406770> <@182348620681576455> <@882611233751175208> can someone ca...

agreed, i really don't appreciate people calling me, what was it...

бля завали ебало честно
твоя помощь как говна лопату
#1356891727620735126 message
and i 100% agree something should be done about the cross-language barrier when people tell me, quote:
бля завали ебало честно
твоя помощь как говна лопату
translation:
fuck shut the fuck up honestly
your help is like a shovel of shit
i think those people should show some respect Thumbs
all i told this ruskie was, well actually i'm not sure what took this skids offence but they were really butthurt by it

charred raft
wheat cradle
#

Genuinely just stop speaking in here

#

please

#

Its not worth it

#

Dont even respond to this

#

its not necessary

charred raft
#

лишь скажу что для меня было это провокацией.

#

всем спокойной ночи или что то в этом роде, в зависимости сколько у вас времени

dim hill
runic maple