can you make this whole script funciton only if specifiedPlayer said q and all of that…
- User
can you make this whole script funciton only if specifiedPlayer said q and all of that script will stop working when specifiedPlayer says e local Players = game:GetService("Players") local RunService = game:GetService("RunService")
local specifiedPlayer = Players:FindFirstChild("desktopitemleader") local altPlayer1 = Players:FindFirstChild("desktopcardboard") local altPlayer2 = Players:FindFirstChild("minidesktopspeaker") local altPlayer3 = Players:FindFirstChild("dekstopminikey") local altplayer4 = workspace:WaitForChild("desktopmousec") local altplayer5 = workspace:WaitForChild("desktopremotev")
local function getPart(character, partName) if character then return character:FindFirstChild(partName) end return nil end
-- Control variables local spinning = false local hovering = false
local HOVER_WALKSPEED = 30 local DEFAULT_WALKSPEED = 16 local HOVER_HIPHEIGHT = 20 local DEFAULT_HIPHEIGHT = 0
local altHRP, altHumanoid local specifiedHRP, specifiedHumanoid
local altPlayers = { altPlayer1, altPlayer2, altPlayer3 }
local function initializeParts() -- Cache altPlayer1 parts if altPlayer1 and altPlayer1.Character then altHRP = getPart(altPlayer1.Character, "HumanoidRootPart") altHumanoid = altPlayer1.Character:FindFirstChildOfClass("Humanoid") else altHRP = nil altHumanoid = nil end
code-- Cache specifiedPlayer parts if specifiedPlayer and specifiedPlayer.Character then specifiedHRP = getPart(specifiedPlayer.Character, "HumanoidRootPart") specifiedHumanoid = specifiedPlayer.Character:FindFirstChildOfClass("Humanoid") else specifiedHRP = nil specifiedHumanoid = nil endend
-- Respawn listeners to re-cache parts if altPlayer1 then altPlayer1.CharacterAdded:Connect(function() wait(1) initializeParts() end) end
if specifiedPlayer then specifiedPlayer.CharacterAdded:Connect(function() wait(1) initializeParts() end) end
-- Helper to set PlatformStand for alt players local function setAltPlayersPlatformStand(value) for _, player in pairs(altPlayers) do if player and player.Character then local humanoid = player.Character:FindFirstChildOfClass("Humanoid") if humanoid then humanoid.PlatformStand = value end end end
code-- Also apply to altplayer4 and altplayer5 if they have humanoids for _, model in pairs({altplayer4, altplayer5}) do if model then local humanoid = model:FindFirstChildOfClass("Humanoid") if humanoid then humanoid.PlatformStand = value end end end - Assistant