I'm attempting to make it so when certain requirements are met, the player will be forced out of the seat they are in (by forcing them to jump) but I haven't found a way to get their character with a global script. I don't want to use a local script, so PLEASE don't suggest the idea. I'll understand if i'm simply just told there is no way to get the player with a global script.
Important part of code:
power = workspace.Power power.Changed:connect(function(newValue) script.Parent.Info.SurfaceGui.Power.Text = "Power: "..newValue.."%" if newValue <= 0 then if workspace.OfficeChair.CamSeat.Occupant ~= nil then local hum = workspace.OfficeChair.CamSeat.Occupant local par = workspace:WaitForChild(hum.Parent) par:FindFirstChildOfClass("Humanoid").Jump = true elseif workspace.OfficeChair.CamSeat.Occupant == nil then print("") end workspace.Usage.Value = 0 workspace.ComputerEnabled.Value = false workspace.Door1.Value = false workspace.Door2.Value = false workspace.LightEnabled.Value = false workspace.ComputerToggle.ClickDetector.MaxActivationDistance = 0 workspace.Door1Switch.DoorButton.ClickDetector.MaxActivationDistance = 0 workspace.Door2Switch.DoorButton.ClickDetector.MaxActivationDistance = 0 workspace.LightSwitch.LightButton.ClickDetector.MaxActivationDistance = 0 end end)
Well you already found the humanoid. To get the character, you can either get the humanoid's parent, or use the .Character
property on player.
local humanoid = ... local player = ... local character = humanoid.Parent -- or local character = player.Character
Hope this helps! :)