Skip to content

Instantly share code, notes, and snippets.

--[[
For the hiddendevs reviewer reading this im gonna include all the scripts scrunched
together here so you can see the number of lines there are.
also i really hope this is good enough it took me a while to make because im bad at ui design
thanks for reviewing me (i added a little funny at the bottom of the commands list in game) :)
]]--
--MAIN modulescript
local Main = {}
--defining admin userids
@WakyCS
WakyCS / CombatClient.lua
Last active January 27, 2025 03:41
The server script for a basic combat system I made
-- 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')
--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')
--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
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
-- 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]
--[[ 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")