I have linked scripts in my weapons so I don't have to go in an edit every single one whenever I want to change it. The problem is, the scripts involve the scripts parent(it decides which animation to play based off a value in the tool), so it ends up using every single scripts parent. Is there any way to edit all of the scripts at once without linked scripts or have the scripts only get their own parent and not every other scripts parent?
01 | --module script |
02 | local _M = { } |
03 | local A = false |
04 | local B = false |
05 | local rs = game:GetService( "ReplicatedStorage" ) |
06 | local players = game:GetService( "Players" ) |
07 |
08 | function _M.attack(player, tool, checker) |
09 | checker = true |
10 | local F = tool.Type.Value |
11 | local a = game:GetService( "ReplicatedStorage" ).Animations:FindFirstChild(F) |
12 | if checker = = true then |
13 | local h = player.Humanoid |
14 | local animTrack = h:LoadAnimation(a) |
15 | animTrack:Play() |
01 | --server script(ill condense this with the local later) |
02 | local B = false |
03 | local e = false |
04 | local checker = script.Parent.Attacking.Value |
05 | local tool = script.Parent |
06 | local rs = game:GetService( "ReplicatedStorage" ) |
07 | local player = tool.Parent.Parent.Character |
08 | local name = player.Name |
09 | local o = name.. "swordout" |
10 | local f = rs.PlayerStuff |
11 | local so = f:FindFirstChild(o) |
12 | local players = game:GetService( "Players" ) |
13 | local plr = players:FindFirstChild(player.Name) |
14 | local myModule = require(game.ServerScriptService.Attacker) |
15 |
01 | --local script |
02 | local A = false |
03 | local equip = false |
04 | local tool = script.Parent |
05 |
06 | function onKeyPress(actionName, userInputState, inputObject) |
07 | if userInputState = = Enum.UserInputState.Begin and A = = false and equip = = true then |
08 | A = true |
09 | local rs = game:GetService( "ReplicatedStorage" ) |
10 | local player = game.Players.LocalPlayer |
11 | local name = player.Name |
12 | local o = name.. "swordout" |
13 | local f = rs.PlayerStuff |
14 | local so = f:FindFirstChild(o) |
15 | so:FireServer() |