카테고리 없음

roblox studio 좀비죽이기 게임 만들기

dullin 2024. 5. 8. 14:31

1. 로블록스 스튜디오 설치

https://create.roblox.com/

 

Roblox Creator Hub

Unlock your imagination with Roblox Creator Hub - the ultimate platform for building and publishing games. Join a vibrant community of creators today and publish your ideas to millions of people around the world. This world is ours for the making!

create.roblox.com

 

프로그램 한국어 설정

 

 

 

 

 

더보기

 

KillCredit 스크립트--

KillCredit 스크립트--
local hum = script.Parent.Humanoid

hum.Died:Connect(function()	
	local tag = hum:FindFirstChild("creator")	
	if tag then
		local player = tag.Value
		local kills = player.leaderstats.Kills
		kills.Value = kills.Value + 1
	end
end)

파트스크립트--
local w = game.ReplicatedStorage["Drooling Zombie"]
local s = script.Parent

while true do
	local c = w:Clone()
	c.Torso.CFrame = s.CFrame
	c.Parent = workspace
	wait(math.random(2,7))
end

damage 스크립트--
local remoteEvent = game.ReplicatedStorage.RemoteEvent
local debris = game:GetService("Debris")

local function tagHumanoid(hum, player)
	local Creator_Tag = Instance.new("ObjectValue", hum)
	Creator_Tag.Name = "creator"
	Creator_Tag.Value = player
	debris:AddItem(Creator_Tag, 2)
end

local function untaagHumaoid(hum)
	for i, v in pairs(hum:GetChildren()) do
		if v:IsA("ObjectValue") and v.Name == "creator" then
			v:Destroy()
		end
	end
end

local function onDamage(player, target, damage)

	local hum = target.Humanoid
	untaagHumaoid(hum)
	tagHumanoid(hum, player)
	hum:TakeDamage(damage)
end

remoteEvent.OnServerEvent:Connect(onDamage)

leaderboard 스크립트--
local function addBoard(player)
	local board = Instance.new("Folder", player)
	board.Name = "leaderstats"
	local kills = Instance.new("IntValue", board)
	kills.Name = "Kills"
end

game.Players.PlayerAdded:Connect(addBoard)

ToolScript(다른 총을 넣을 때 끼워넣기)--
local function OnActivated()
	
	game.ReplicatedStorage.RemoteEvent:FireServer(game.Players.LocalPlayer:GetMouse().Target.Parent, 25)  -- damage : 25
	
	if Tool.Enabled and Humanoid.Health > 0 then

파트 생성 후 스크립트 추가

스폰 생성 해주기

 

이후 ReplicatedStorage 밑에 RemoteEvent 추가

ServerScriptService 밑에 Damage, Leaderboard 두가지 스크립트 추가

staterPack 밑에 총 넣기

다른 총 넣을 경우 ToolScript 집어넣기

 

walkspeed gui 추가

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

반응형