-- Services local ReplicatedStorage = game:GetService("ReplicatedStorage") local…
- User
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
-- Services local ReplicatedStorage = game:GetService("ReplicatedStorage") local ServerStorage = game:GetService("ServerStorage") local Workspace = game:GetService("Workspace")
-- Objects local tablicaMala = Workspace:WaitForChild("czasmaly") local centralMala = tablicaMala:WaitForChild("Central") local tablicaMain = Workspace:WaitForChild("maintablica") local centralMain = tablicaMain:WaitForChild("Central")
-- Colors local COLOR_GREEN = Color3.new(0.117647, 0.192157, 0.129412) local COLOR_BLACK = Color3.new(0.0666667, 0.0666667, 0.0666667)
-- Events local PlayerReady = ReplicatedStorage:WaitForChild("PlayerReady") local Loaded = ReplicatedStorage:WaitForChild("Loaded") local FrontDoors = ReplicatedStorage:WaitForChild("FrontDoors") local BrigadeEvent = ReplicatedStorage:WaitForChild("1") local brigadaTemplate = ServerStorage:WaitForChild("1") local function enableBrigadeScripts(brigade) if not brigade:IsA("Model") then return end for _, subModel in ipairs(brigade:GetChildren()) do if subModel:IsA("Model") then for _, item in ipairs(subModel:GetChildren()) do if item.Name == "Script" and item:IsA("Script") then item.Enabled = true end end end end end Loaded.OnServerEvent:Connect(function(player) if not player then return end local function updateUI() centralMain.SurfaceGui.Start.BG1.Visible = false task.wait(3) centralMain.Color = COLOR_GREEN task.wait(1) centralMain.SurfaceGui.Start.BG2.Visible = true end local function spawnBrigade() local brigadeClone = brigadaTemplate:Clone() brigadeClone.Parent = Workspace:WaitForChild("brygady") enableBrigadeScripts(brigadeClone) return brigadeClone end updateUI() task.wait(7) FrontDoors:FireClient(player) task.wait(0.05) local currentBrigade = spawnBrigade() BrigadeEvent.OnServerEvent:Connect(function(triggerPlayer) if triggerPlayer ~= player then return end FrontDoors:FireClient(player) ReplicatedStorage.GLRL_GORA:FireClient(triggerPlayer) if currentBrigade then wait(3) currentBrigade:Destroy() end local gracz1UI = centralMain.SurfaceGui.Start.BG2.Starting.gracz1 gracz1UI.Visible = true task.wait(7) gracz1UI.Visible = false ReplicatedStorage.GLRL_D:FireClient(triggerPlayer) local spawnFolder = game.Workspace.SpawnyGLRL local spawnp = spawnFolder:GetChildren() if #spawnp == 0 then warn("No spawn points found in SpawnyGLRL!") return end ReplicatedStorage.ToggleDayPlan:FireAllClients("SHOW") wait(0.5) local randomIndex = math.random(1, #spawnp) local randomSpawn = spawnp[randomIndex] local character = triggerPlayer.Character if character and character:FindFirstChild("HumanoidRootPart") then local humanoidRootPart = character.HumanoidRootPart humanoidRootPart.CFrame = randomSpawn.CFrame * CFrame.new(0, 1, 0) else warn("Character not found or missing HumanoidRootPart") end wait(0.5) ReplicatedStorage.ToggleDayPlan:FireAllClients("HIDE") local clone_chmur = ServerStorage.chmuren:Clone() clone_chmur.Parent = game.Workspace.GL_RL wait(2) ReplicatedStorage.GLRL_GORA:FireClient(triggerPlayer) wait(10) ReplicatedStorage.GLRL_D:FireClient(triggerPlayer) game.Workspace.GL_RL.SquidGame.SquidGameServer.Enabled = true triggerPlayer.PlayerGui.RLGL.Frame.Visible = true ReplicatedStorage.GLRL_GORA:FireClient(triggerPlayer) wait(3) game.Workspace.GL_RL.chmuren:Destroy() centralMain.SurfaceGui.Start.BG1.Visible = false centralMain.SurfaceGui.Start.BG.Visible = true end) end)
could you make like after this: "ReplicatedStorage.GLRL_D:FireClient(triggerPlayer)"
like if player is in "waitingpart_gl_rl" in workspace then it like health = 0
Certainly! Here's how you can modify the code to check if the player is in a part named "waitingpart_gl_rl" in the Workspace and set their health to 0 if they are:
ReplicatedStorage.GLRL_D:FireClient(triggerPlayer)
-- Check if player is in waitingpart_gl_rl and set health to 0
local waitingPart = Workspace:FindFirstChild("waitingpart_gl_rl")
if waitingPart then
local character = triggerPlayer.Character
if character then
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
local rootPart = character:FindFirstChild("HumanoidRootPart")
if rootPart then
-- Check if player's position is inside the waiting part
if (rootPart.Position - waitingPart.Position).Magnitude <= waitingPart.Size.Magnitude/2 then
humanoid.Health = 0
end
end
end
end
end
This modification:
You would insert this code right after the ReplicatedStorage.GLRL_D:FireClient(triggerPlayer) line.
For a more precise collision check, you might want to use GetTouchingParts() instead of distance checking, but this simple version should work for most cases.
Would you like me to make any adjustments to this implementation?
can you make for me an script like if someone died like you know because of health = 0 then it need to play animation like this body stays there and you know it's supposed to be messed with and like this animation is supposed to be there you know like when it's over it's supposed to freeze
Here's a script that will handle player death animations and freeze the body in place when the animation completes. This script should be placed in a Script under ServerScriptService:
local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")
-- Load the death animation (replace with your actual animation ID or Animation object)
local deathAnimation = Instance.new("Animation")
deathAnimation.AnimationId = "rbxassetid://YOUR_ANIMATION_ID_HERE" -- Replace with your animation ID
deathAnimation.Name = "DeathAnim"
deathAnimation.Parent = ServerStorage
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid")
humanoid.Died:Connect(function()
-- Wait a moment before starting the animation
task.wait(0.5)
-- Load and play death animation
local animator = humanoid:FindFirstChildOfClass("Animator")
if animator then
local deathAnimTrack = animator:LoadAnimation(deathAnimation)
deathAnimTrack:Play()
-- When animation completes, freeze the body
deathAnimTrack.Stopped:Connect(function()
-- Make sure character still exists
if character and character.Parent then
-- Freeze all parts
for _, part in ipairs(character:GetDescendants()) do
if part:IsA("BasePart") then
part.Anchored = true
end
end
-- Optionally add some death effects
local head = character:FindFirstChild("Head")
if head then
-- Example: Add blood decal
local blood = Instance.new("Decal")
blood.Texture = "rbxassetid://YOUR_BLOOD_TEXTURE_ID" -- Replace with blood texture
blood.Face = Enum.NormalId.Top
blood.Parent = head
end
end
end)
end
end)
end)
end)
YOUR_ANIMATION_ID_HERE with the actual Roblox animation ID you want to play on death.YOUR_BLOOD_TEXTURE_ID with a blood decal texture if you want that effect.ServerScriptService.Would you like me to modify any part of this script to better fit your game's needs? For example, I could add: