RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"how can we take the ticket variable and put it into a settings module script"
-- server script local Settings = require(game:GetService("ServerScriptService"):WaitForChild("SettingsModule")) -- Assuming the module is named "SettingsModule" and is in ServerScriptService local scanner = script.Parent local canOpen = true local Ticket = Settings.Ticket -- Get the Ticket from the settings module local debounce = false local GUIEvent = script.Parent.Parent.GUIEvent local TweenService = game:GetService("TweenService") -- Get the TweenService GUIEvent.OnServerEvent:Connect(function(player, action) script.Parent.Parent.Door1.Door1.Motor.DesiredAngle = 1.6 script.Parent.Parent.Door2.Door2.Motor.DesiredAngle = -1.6 wait(2) -- wait for 2 seconds before closing the doors print("Doors closed") script.Parent.Parent.Door1.Door1.Motor.DesiredAngle = 0 script.Parent.Parent.Door2.Door2.Motor.DesiredAngle = 0 canOpen = true end) local originalPosition = UDim2.new(0.474, 0,-1.1, 0) local middlePosition = UDim2.new(0.474, 0,0.454, 0) local function openDoors(player) if canOpen then canOpen = false player.PlayerGui.FingerprintGUI.Enabled = true local FingerprintGUI = player.PlayerGui.FingerprintGUI.GUI local guiTweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out) local guiTween = TweenService:Create(FingerprintGUI, guiTweenInfo, {Position = middlePosition}) guiTween:Play() player.PlayerGui.FingerprintGUI.Value.Value = script.Parent.Parent print("Waiting for GUI to be closed...") end end local function onHit(hit) print("Scanner touched") if debounce then return end debounce = true local tool = hit.Parent:FindFirstChild(Ticket) if tool and tool:IsA("Tool") then print("Passport detected") local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then openDoors(player) end end debounce = false end scanner.Touched:Connect(onHit)