yk what i want malee combat to be a main part of the game but i also want to make it so you have to make a base but then i want you to make a clan so let have all booga boga recoures with a few others that you can use to make like cannons and stuff like that for something for a base you will be getting guns like aks or glocks or shotguns for dounges that you have to get keys for by mineing stuff like gods they have god in booga booga yk what am getting at
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Below is a COMPLETE “starter kit” that will let you:
Swing a melee weapon that does damage and plays hit FX.
Chop trees / mine rocks / mine a “God” statue that can drop dungeon keys.
Spawn & collect every Booga-Booga-style resource (plus a few new ones).
Place simple base parts (walls / floors / cannon mount) in a build mode.
Create / join / leave a Clan that’s saved with DataStore.
Nothing here is copy-protected, so feel free to paste straight into Studio and iterate.
I have broken the system into clean modules so you can expand later with guns, cannons, dungeons, etc.
────────────────────────────────────────
📂 1. FOLDER / PLACE ORGANISATION
────────────────────────────────────────
ReplicatedStorage
┣ Resources.lua -- Resource definitions (server & client share)
┣ RemoteEvents
┃ ┣ CombatHit -- client → server: “I hit something”
┃ ┣ RequestBuild -- client → server: place a part
┃ ┗ ClanEvent -- all clan remote requests
┗ SharedModules
┣ CombatService.lua
┗ BuildValidator.lua
────────────────────────────────────────
⚔️ 3. COMBAT SERVICE (ReplicatedStorage/SharedModules/CombatService.lua)
────────────────────────────────────────
lua
-- CombatService.lua (require()d by server)
local CombatService = {}
local Players = game:GetService("Players")
local remote = game.ReplicatedStorage.RemoteEvents.CombatHit
-- CONFIG
local WEAPON_DATA = { -- you can expand here
WoodenSword = {damage = 20, cd = 0.5},
StoneAxe = {damage = 10, cd = 0.7},
}
-- state table to stop spamming
local nextSwingAllowed = {}
-------------------------------------------------
function CombatService:SwordSwing(player, toolName, hitPart)
local weaponStats = WEAPON_DATA[toolName]
if not weaponStats then return end
local now = tick()
if nextSwingAllowed[player] and now < nextSwingAllowed[player] then return end
nextSwingAllowed[player] = now + weaponStats.cd
local char = hitPart:FindFirstAncestorOfClass("Model")
local targetPlayer = Players:GetPlayerFromCharacter(char)
if targetPlayer and targetPlayer ~= player then
local humanoid = char:FindFirstChildOfClass("Humanoid")
if humanoid and humanoid.Health > 0 then
humanoid:TakeDamage(weaponStats.damage)
end
end
end
-------------------------------------------------
-- hook RemoteEvent
remote.OnServerEvent:Connect(function(player, toolName, hitPart)
CombatService:SwordSwing(player, toolName, hitPart)
end)
return CombatService
────────────────────────────────────────
🪓 4. TOOL SCRIPTS (inside each Tool)
────────────────────────────────────────
WoodenSword / StoneAxe BOTH get the same LocalScript (rename if you like).
lua
-- LocalScript inside the Tool
local tool = script.Parent
local player = game.Players.LocalPlayer
local remote = game.ReplicatedStorage.RemoteEvents.CombatHit
tool.Activated:Connect(function()
-- simple raycast forward from the mouse
local mouse = player:GetMouse()
local target = mouse.Target
if target then
remote:FireServer(tool.Name, target)
end
end)
Server side damage is handled by CombatService (above).
-- Spawns trees / rocks / Gods repeatedly
local rsStorage = game.ServerStorage
local resFolder = workspace:WaitForChild("ResourceFolder")
local Resources = require(game.ReplicatedStorage.Resources)
local function createTree()
local tree = Instance.new("Part")
tree.Size = Vector3.new(4,10,4)
tree.BrickColor = Resources.WOOD.color
tree.Name="Tree"
tree.Anchored = true
tree.Parent = resFolder
-- HP
local hp = Instance.new("IntValue", tree)
hp.Name="HP"
hp.Value=100
end
-- same style for Rock & God
local function createRock()
local rock = Instance.new("Part")
rock.Size=Vector3.new(6,4,6)
rock.Shape=Enum.PartType.Block
rock.BrickColor=Resources.STONE.color
rock.Name="Rock"
rock.Anchored=true
rock.Parent=resFolder
local hp=Instance.new("IntValue", rock); hp.Name="HP"; hp.Value=150
end
local function createGod()
local g = Instance.new("Part")
g.Size=Vector3.new(8,12,8)
g.Shape=Enum.PartType.Block
g.BrickColor=Resources.GOLD.color
g.Name="God"
g.Anchored=true
g.Parent=resFolder
local hp=Instance.new("IntValue", g); hp.Name="HP"; hp.Value=350
end
-- Re-spawn cycle
while true do
if #resFolder:GetChildren() < 40 then
local roll = math.random()
if roll < 0.6 then createTree()
elseif roll < 0.9 then createRock()
else createGod()
end
end
wait(5)
end
────────────────────────────────────────
🧱 6. BUILDING – VALIDATION MODULE (ReplicatedStorage/SharedModules/BuildValidator.lua)
────────────────────────────────────────
lua
local module = {}
-- Make sure the ghost part doesn’t collide with other base parts
function module.IsPositionValid(cf, partSize, ignoreList)
local region = Region3.new(cf.Position - partSize/2, cf.Position + partSize/2)
local parts = workspace:FindPartsInRegion3WithIgnoreList(region, ignoreList, 10)
for _,p in ipairs(parts) do
if p.Name ~= "Terrain" and not p:IsDescendantOf(ignoreList[1]) then
return false
end
end
return true
end
return module
local plr = game.Players.LocalPlayer
local tool = plr.Backpack:WaitForChild("BuildHammer")
local buildRemote = game.ReplicatedStorage.RemoteEvents.RequestBuild
local BuildValidator = require(game.ReplicatedStorage.SharedModules.BuildValidator)
local mouse = plr:GetMouse()
local ghost -- translucent preview
tool.Activated:Connect(function()
if ghost then ghost:Destroy(); ghost=nil end
local partTemplate = game.ServerStorage.PlaceableParts.WallPart -- default
ghost = partTemplate:Clone()
ghost.Transparency = 0.5
ghost.CanCollide = false
ghost.Parent = workspace
-- Move ghost w/ mouse
local conn
conn = game:GetService("RunService").RenderStepped:Connect(function()
local hit = mouse.Hit
if hit then
ghost.CFrame = CFrame.new(hit.p):ToWorldSpace(CFrame.new(0, ghost.Size.Y/2, 0))
end
end)
-- confirm with left-click
mouse.Button1Down:Wait()
conn:Disconnect()
local valid = BuildValidator.IsPositionValid(ghost.CFrame, ghost.Size, {plr.Character})
if valid then
buildRemote:FireServer("WallPart", ghost.CFrame)
end
ghost:Destroy()
end)
Server side (in MainServer.lua or separate script):
lua
local buildRemote = game.ReplicatedStorage.RemoteEvents.RequestBuild
local placeFolder = game.ServerStorage.PlaceableParts
local BuildValidator = require(game.ReplicatedStorage.SharedModules.BuildValidator)
buildRemote.OnServerEvent:Connect(function(plr, partName, cf)
local template = placeFolder:FindFirstChild(partName)
if not template then return end
local valid = BuildValidator.IsPositionValid(cf, template.Size, {plr.Character})
if not valid then return end
local newPart = template:Clone()
newPart.CFrame = cf
newPart.Parent = workspace:FindFirstChild(plr.Name .. "_Base") or workspace
end)
────────────────────────────────────────
👥 8. CLAN SERVICE (ServerScriptService/ClanService.lua)
────────────────────────────────────────
lua
local DataStoreService = game:GetService("DataStoreService")
local ClanStore = DataStoreService:GetDataStore("Clans_v1")
local ClanService = {}
local clans = {} -- [clanId] = {name="", members={player.UserId,...}}
-------------------------------------------------
function ClanService:CreateClan(player, clanName)
local id = tostring(math.random(1,9)..math.random(1,999999)) -- cheap uid
clans[id] = {name = clanName, members = {player.UserId}}
ClanStore:SetAsync(id, clans[id])
return id
end
function ClanService:JoinClan(player, clanId)
local clan = clans[clanId] or ClanStore:GetAsync(clanId)
if not clan then return false end
clan.members[#clan.members+1] = player.UserId
clans[clanId] = clan
ClanStore:SetAsync(clanId, clan)
return true
end
function ClanService:LeaveClan(player, clanId)
local clan = clans[clanId]
if not clan then return end
for i,uid in ipairs(clan.members) do
if uid == player.UserId then
table.remove(clan.members, i)
break
end
end
ClanStore:SetAsync(clanId, clan)
end
return ClanService
Client GUI can send remote calls through RemoteEvents.ClanEvent
(example parameters: {"Create", "MyCoolClan"}, {"Join", clanId}, {"Leave", clanId}).
Server side hook (in MainServer.lua):
lua
local clanRemote = game.ReplicatedStorage.RemoteEvents.ClanEvent
local ClanService = require(script.Parent.ClanService)
clanRemote.OnServerEvent:Connect(function(plr, payload)
local action = payload[1]
if action == "Create" then
local clanName = payload[2]
ClanService:CreateClan(plr, clanName)
elseif action == "Join" then
ClanService:JoinClan(plr, payload[2])
elseif action == "Leave" then
ClanService:LeaveClan(plr, payload[2])
end
end)
────────────────────────────────────────
🗝️ 9. GOD STATUE → KEY DROP
────────────────────────────────────────
Put this Script inside every God part (or manage centrally):
lua
local part = script.Parent
local Resources = require(game.ReplicatedStorage.Resources)
part.Touched:Connect(function(hit)
local tool = hit.Parent:FindFirstChildWhichIsA("Tool")
if tool and tool.Name == "StoneAxe" then
local hp = part:FindFirstChild("HP")
if hp then
hp.Value = hp.Value - 25
if hp.Value <= 0 then
-- drop a key
local key = Instance.new("Part")
key.Size = Vector3.new(1,1,1)
key.Shape= Enum.PartType.Ball
key.BrickColor = Resources.DUNGEON_KEY.color
key.Name = "DungeonKey"
key.Position = part.Position + Vector3.new(0,5,0)
key.Parent = workspace
part:Destroy()
end
end
end
end)
Players can collect keys with a simple Touched pickup script (very similar to wood/stone pickup).
────────────────────────────────────────
🚀 10. WHERE TO GO FROM HERE
────────────────────────────────────────
Add ranged weapons: create a Gun tool, a bullet RemoteEvent, and reuse CombatService.
Replace “cheap” anti-exploit checks with proper raycast hit-reg and server-side prediction.
Expand base building: doors with locks, building tiers (wood/stone/metal).
Add clan base protection & raid windows.
────────────────────────────────────────
🎉 THAT’S IT!
────────────────────────────────────────
Paste these scripts into the file structure shown, press Play in Studio, and you already have: