Hello! I'm trying to fix an assault rifle scripted by TurboFussion, but it doesn't work since the experimental mode was discontinued. I think that it does not work well because the clientMain script is a LocalScript. Can you help me to change things so I can put it on a normal script in the tool? This is the Script, but I don't insert it entirely because this website limits characters to 10,000.

repeat wait() until game.Players.LocalPlayer.Character
repeat wait() until game.Players.LocalPlayer.Character:IsDescendantOf(game.Workspace)
wait(1 / 20)

--------------------------------------------------------------------------------------
--------------------[ IGNORE MODEL ]--------------------------------------------------
--------------------------------------------------------------------------------------

local ignoreCode = script:WaitForChild("ignoreCode")

repeat wait() until ignoreCode.Value ~= 0

local ignoreModel = game.Workspace:WaitForChild("ignoreModel_"..ignoreCode.Value)

local grenadeFolder = ignoreModel:WaitForChild("grenadeFolder")

--------------------------------------------------------------------------------------
--------------------[ CONSTANTS ]-----------------------------------------------------
--------------------------------------------------------------------------------------

local Gun = script.Parent
local serverMain = Gun:WaitForChild("serverMain")
local Handle = Gun:WaitForChild("Handle")
local AimPart = Gun:WaitForChild("AimPart")
local Main = Gun:WaitForChild("Main")

local Ammo = Gun:WaitForChild("Ammo")
local ClipSize = Gun:WaitForChild("ClipSize")
local StoredAmmo = Gun:WaitForChild("StoredAmmo")

local createTweenIndicator = serverMain:WaitForChild("createTweenIndicator")
local deleteTweenIndicator = serverMain:WaitForChild("deleteTweenIndicator")
local getWeldCF = serverMain:WaitForChild("getWeldCF")
local gunSetup = serverMain:WaitForChild("gunSetup")
local lerpCF = serverMain:WaitForChild("lerpCF")
local createBlood = serverMain:WaitForChild("createBlood")
local createBulletImpact = serverMain:WaitForChild("createBulletImpact")
local createShockwave = serverMain:WaitForChild("createShockwave")
local createTrail = serverMain:WaitForChild("createTrail")

local Particle = require(script:WaitForChild("Particle"))
local Spring = require(script:WaitForChild("Spring"))
local Anims = require(Gun:WaitForChild("ANIMATIONS"))
local Plugins = require(Gun:WaitForChild("PLUGINS"))
local S = require(Gun:WaitForChild("SETTINGS"))

local Player = game.Players.LocalPlayer
local Char = Player.Character
local Humanoid = Char:WaitForChild("Humanoid")
local Torso = Char:WaitForChild("Torso")
local Head = Char:WaitForChild("Head")
local HRP = Char:WaitForChild("HumanoidRootPart")
local Root = HRP:WaitForChild("RootJoint")

local Neck = Torso:WaitForChild("Neck")

local LArm = Char:WaitForChild("Left Arm")
local RArm = Char:WaitForChild("Right Arm")
local LLeg = Char:WaitForChild("Left Leg")
local RLeg = Char:WaitForChild("Right Leg")

local M2 = Player:GetMouse()

local mainGUI = script:WaitForChild("mainGUI")
	
local crossHair = mainGUI:WaitForChild("crossHair")
local HUD = mainGUI:WaitForChild("HUD")
local Scope = mainGUI:WaitForChild("Scope")
local fireSelect = mainGUI:WaitForChild("fireSelect")
local hitMarker = mainGUI:WaitForChild("hitMarker")
local Sens = mainGUI:WaitForChild("Sens")

local crossA = crossHair:WaitForChild("A"):WaitForChild("Line")
local crossB = crossHair:WaitForChild("B"):WaitForChild("Line")
local crossC = crossHair:WaitForChild("C"):WaitForChild("Line")
local crossD = crossHair:WaitForChild("D"):WaitForChild("Line")

local Controls = HUD:WaitForChild("Controls")

local gunNameTitle = HUD:WaitForChild("gunName"):WaitForChild("Title")

local scopeMain = Scope:WaitForChild("Main")
local scopeSteady = Scope:WaitForChild("Steady")

local fireModes = fireSelect:WaitForChild("Modes")

local modeGUI = HUD:WaitForChild("Mode"):WaitForChild("Main")
local clipAmmoGUI = HUD:WaitForChild("Ammo"):WaitForChild("Clip")
local storedAmmoGUI = HUD:WaitForChild("Ammo"):WaitForChild("Stored")

local DS = game:GetService("Debris")
local CP = game:GetService("ContentProvider")
local RS = game:GetService("RunService")
local UIS = game:GetService("UserInputService")

local Cam = game.Workspace.CurrentCamera

local ABS, HUGE, FLOOR, CEIL = math.abs, math.huge, math.floor, math.ceil
local RAD, SIN, COS, TAN = math.rad, math.sin, math.cos, math.tan
local VEC2, V3 = Vector2.new, Vector3.new
local CF, CFANG = CFrame.new, CFrame.Angles
local INSERT = table.insert

local maxStamina = S.sprintTime * 60
local maxSteadyTime = S.scopeSettings.steadyTime * 60

local LethalIcons = {
	"http://www.roblox.com/asset/?id=194849880";
	"http://www.roblox.com/asset/?id=195727791";
	"http://www.roblox.com/asset/?id=195728137";
	"http://www.roblox.com/asset/?id=218151830";
}

local TacticalIcons = {
	"http://www.roblox.com/asset/?id=195728473";
	"http://www.roblox.com/asset/?id=195728693";

Thank you.

2 comments

0

Handle the bullet being touched with the damage on the server and use remotefunctions/events to commuicate back to the localscript if needed. For remotefunction/event info see: https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events

0

But the problem is that the weapon only loads if it is in the localscript