This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --[[ The movementsystem table was originally intended to be a modulescript for better readability, but | |
| moving it into this script is neccessary to meet the requirements and keep it all in one script. ]]-- | |
| -- this is my movement system, inspired by the game "Grace" on roblox | |
| -- VARIABLES | |
| -- Player Info | |
| local Player = game:GetService("Players").LocalPlayer | |
| local Char = script.Parent | |
| local Animate = Char:WaitForChild("Animate") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Making a copy of a modulescript to use its functions in this script | |
| local Services = require(game:GetService("ReplicatedStorage"):WaitForChild("Modules"):WaitForChild("Services")) | |
| local Client = require(Services.Folders.Modules:WaitForChild("Client")) | |
| -- The GunInfo module contains information about the gun (firerate, magsize, sound and animation ids, etc) | |
| local GunInfoModule = require(Services.Folders.Modules:WaitForChild("GunInfo")) | |
| local player = game.Players.LocalPlayer | |
| -- Gets info about the player so you don't have to define a bunch of variables and it just gives you them in a table | |
| local CharInfo = Client.GetCharInfo(player) | |
| local tool = script.Parent | |
| local GunInfo = GunInfoModule[tool.Name] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| repeat | |
| task.wait() | |
| until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and | |
| game.Players.LocalPlayer.Character:findFirstChild("Torso") and | |
| game.Players.LocalPlayer.Character:findFirstChild("Humanoid") | |
| local mouse = game.Players.LocalPlayer:GetMouse() | |
| repeat | |
| task.wait() | |
| until mouse | |
| local plr = game.Players.LocalPlayer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --Defining variables | |
| local players = game:GetService('Players') | |
| local player = players.LocalPlayer | |
| local character = player.Character or player.CharacterAdded:Wait() | |
| local hrp = character:FindFirstChild('HumanoidRootPart') | |
| local rs = game:GetService('ReplicatedStorage') | |
| local uis = game:GetService('UserInputService') | |
| local remotes = rs:WaitForChild('Remotes') | |
| local hitboxmodule = require(rs:WaitForChild('Hitbox')) | |
| local camera = workspace.CurrentCamera |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --lines before comments: 205 | |
| --most of the animations were NOT made by me. | |
| --defining variables | |
| local player = game.Players.LocalPlayer | |
| local character = player.Character or player.CharacterAdded:Wait() | |
| local hrp:BasePart = character.HumanoidRootPart | |
| local hum:Humanoid = character.Humanoid | |
| --setting the player walkspeed to be a bit slower because it works better with the animation | |
| hum.WalkSpeed = 12 | |
| local rs = game:GetService('ReplicatedStorage') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- I didn't add any comments to this because I'm assuming that you only need to add them to the 200 line one. Correct me if I'm wrong | |
| -- SCROLL DOWN THE PAGE FOR THE 200 LINE ONE, IDK WHY GITHUB MAKES THIS THE FIRST SCRIPT TO SHOW | |
| local player = game.Players.LocalPlayer | |
| local rs = game:GetService('ReplicatedStorage') | |
| local character = player.Character or player.CharacterAdded:Wait() | |
| local hrp = character.HumanoidRootPart | |
| local hum = character.Humanoid | |
| local remotes = rs:WaitForChild('Remotes') | |
| local animations = rs:WaitForChild('Animations') | |
| local animator = hum:WaitForChild('Animator') |