Skip to content
Om Puter

Om Puter

Berbagi Tutorial Coding dan Pemrograman Komputer

Menu
  • Channel YouTube ThirteeNov
  • Channel YouTube Om Puter
Menu

Script Check Point di Roblox

Posted on 11 September 202512 September 2025 by OmPuter

Untuk membuat checkpoint di Roblox, kita perlu membuat sebuah object, misal balok kotak. Kita centang CanCollide dan Anchored.

Terus tambahkan script ini:

local checkpoint = script.Parent

checkpoint.Touched:Connect(function(hit)
	local character = hit.Parent
	local player = game.Players:GetPlayerFromCharacter(character)
	if player and character:FindFirstChild("HumanoidRootPart") then
		-- Simpan posisi checkpoint di attribute player
		player:SetAttribute("Checkpoint", checkpoint.Position + Vector3.new(0, 5, 0))
		print(player.Name .. " reached checkpoint at " .. tostring(checkpoint.Position))
	end
end)

Setelah itu, Di ServerScriptService, tambahkan Script baru (misalnya CheckpointHandler) dengan isi:

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local checkpointPos = player:GetAttribute("Checkpoint")
		if checkpointPos then
			-- kalau player sudah punya checkpoint, spawn di sana
			local root = character:WaitForChild("HumanoidRootPart")
			task.wait(0.1) -- kasih jeda supaya posisi stabil
			root.CFrame = CFrame.new(checkpointPos)
		else
			-- kalau belum punya checkpoint, biarkan spawn default (SpawnLocation)
			print(player.Name .. " spawn di lokasi default")
		end
	end)
end)
Post Views: 369

Kategori

  • 3D Max
  • Adobe Animate
  • Android
  • c#
  • Cordova
  • HTML5, CSS & JavaScript
  • iOS
  • Lain-lain
  • Photoshop
  • PHP
  • Python
  • Roblox
  • Tak Berkategori
  • Unity
  • WordPress
ciihuy2020
© 2026 Om Puter | Powered by Superbs Personal Blog theme