Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Script by lnsertYourself
- local whitelist = {"alwaysbloo", "lnsertYourself"}
- local openCommand = "!open"
- local closeCommand = "!close"
- local fadeLength = 1
- --// DO NOT MODIFY BEYOND THIS POINT \\--
- local tweenService = game:GetService("TweenService")
- local tweenInfo = TweenInfo.new(fadeLength, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false ,0)
- game.Players.PlayerAdded:Connect(function(player)
- if table.find(whitelist, player.Name) then
- -- Player is whitelisted to use commands
- player.Chatted:Connect(function(message)
- if string.sub(message, 1,5) == openCommand then
- -- Open command
- local door = workspace:FindFirstChild(string.sub(message, 7))
- if door then
- -- Door to open found
- local tween = tweenService:Create(door, tweenInfo, {Transparency = 1})
- tween:Play()
- tween.Completed:Wait()
- door.CanCollide = false
- end
- elseif string.sub(message, 1,6) == closeCommand then
- -- Close command
- local door = workspace:FindFirstChild(string.sub(message, 8))
- if door then
- -- Door to close found
- local tween = tweenService:Create(door, tweenInfo, {Transparency = 0}):Play()
- door.CanCollide = true
- end
- end
- end)
- end
- end)
Add Comment
Please, Sign In to add comment