https://drive.google.com/file/d/1HcUO_oA9vxyLsertA6siLZmcykiVpFYW/view?usp=drive_link Local Script pada Text HarvestCount local player = game.Players.LocalPlayer local textLabel = script.Parent --Tunggu leaderstats muncul player:WaitForChild("leaderstats") local harvest = player.leaderstats:WaitForChild("Harvest") --Update GUI saat nilai berubah harvest.Changed:Connect(function(value) textLabel.Text = "Harvest: " .. harvest.value end) --set awal textLabel.Text = "Harvest: " .. harvest.Value Script ke-1 untuk crop local crop = script.Parent local clickDetector = crop:WaitForChild("ClickDetector") clickDetector.MouseClick:Connect(function(player) --Buat nilai leadertstats kalau belum ada local leaderstats = player:FindFirstChild("leaderstats") if not leaderstats then leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player end --Buat nilai hasil ...
Script Roblox Studio Karakter Mati Saat Terjatuh Dari Ketinggian local Root = script.Parent:WaitForChild("HumanoidRootPart") local Humanoid = script.Parent:WaitForChild("Humanoid") local Enable = false local EndPosition = 0 Humanoid.StateChanged:Connect(function(oldState, newState) if newState ~= Enum.HumanoidStateType.Freefall then Enable = false end end) function onFreeFall() print(Root.Position.Y) EndPosition = Root.CFrame * Vector3.new(0, -Humanoid.JumpPower, 0) print(EndPosition.Y) Enable = true while Enable == true do wait(0.01) if Root.Position.Y <= EndPosition.Y then Humanoid.Health = 0 end end end Humanoid.FreeFalling:connect(onFreeFall)
Buat part untuk lintangan sebagai lava, neon ataupun part yang tidak boleh di lewati. Sebagai contoh disini memakai neon. Jika avatar terkena neon berwarna kuning maka avatar akan mati, SCRIPT KILL PLAYER local lava = script.parent local function killplayer(otherPart) local partParent = otherPart.parent local humanoid = partParent:FindFirstChild("Humanoid") if humanoid then humanoid.Health = 0 end end lava.Touched:connect(killplayer)
Komentar
Posting Komentar