mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Add nil check for UserInputService
Added a nil check for UserInputService to handle non-Roblox environments.
This commit is contained in:
parent
bf4f46f784
commit
28f909cf90
1 changed files with 7 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
local UserInputService = game:GetService("UserInputService")
|
||||
local UserInputService = game and game:GetService("UserInputService") or nil
|
||||
|
||||
local function clamp(x, a, b)
|
||||
if x < a then return a end
|
||||
|
|
@ -140,6 +140,12 @@ return function(create, source, action, cleanup)
|
|||
create "UIStroke" { Thickness = 1, Color = Color3.fromRGB(0, 0, 0), Transparency = 0.75 },
|
||||
|
||||
action(function(btn)
|
||||
-- In non-Roblox test environments, game/UserInputService may not exist.
|
||||
-- The slider should still be requireable, and still render; dragging is disabled.
|
||||
if not UserInputService then
|
||||
return
|
||||
end
|
||||
|
||||
local dragInput
|
||||
local dragging = false
|
||||
local beganConn
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue