Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

i got a problem with reload script for gun how do i fix this?

heres my script

if canReload:InvokeServer() then --//Reload reloadRemote:FireServer()

    if reloadTrack then
        reloadTrack:Play()
    end
    wait(1)
    local Mag = tool.Mag:Clone()
    Mag.Parent = workspace
    tool.Mag.Transparency = 1
end

end

so when it runs it clones the mag but deletes itself pls help

1 answer

In your code, you did not tell where the Mag's position should be, so by default it would be at 0,0,0. You need to set the position of the Mag after you set it's parent to Workspace.

local Mag = tool.Mag:Clone()
Mag.Parent = game.Workspace
Mag.Position = Vector3.new(5,5,7) -- This will make the Mag's position to 5,5,7. But you need to put the position to the gun. This is just an example.
Mag.Velocity =	 Vector3.new(5,5,7)	-- Also give it velocity to make it actually shoot, giving how much force or speed.
Mag.Transparency = 1

On the velocity part, you would need to use something called lookVector search it up on Google. For information about it.

This discussion is preserved as it was. New answers, comments, and votes are closed.