Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- params : ...
- local player = game.Players.LocalPlayer
- local character = player.Character
- local humanoid = character:WaitForChild("Humanoid")
- local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
- local userInputService = game:GetService("UserInputService")
- local contextActionService = game:GetService("ContextActionService")
- local replicatedStorage = game:GetService("ReplicatedStorage")
- local event = replicatedStorage:WaitForChild("RemoteEvent")
- local debounce = require(replicatedStorage:WaitForChild("DebounceModule"))
- local animations = replicatedStorage:WaitForChild("Animations")
- local animTrackCrawl = humanoid:LoadAnimation(animations:WaitForChild("AnimCrawl"))
- local trackTyping = humanoid:LoadAnimation(animations:WaitForChild("AnimTyping"))
- local trackCarry = humanoid:LoadAnimation(animations:WaitForChild("AnimCarry"))
- local playerStats = require(player:WaitForChild("TempPlayerStatsModule"))
- local gui = player.PlayerGui.ScreenGui
- local actionBox = gui:WaitForChild("ActionBox")
- local progressBox = gui:WaitForChild("ProgressBox")
- local onTrigger = false
- CrawlFunction = function(actionName, actionInputState, actionInputObject)
- -- DECOMPILER ERROR at PC20: Unhandled construct in 'MakeBoolean' P1
- if userInputService.TouchEnabled == true and actionInputState == Enum.UserInputState.Begin then
- if playerStats.GetValue("IsCrawling") == true then
- event:FireServer("Input", "Crawl", false)
- humanoid.HipHeight = 0
- animTrackCrawl:Stop()
- humanoid.WalkSpeed = 16
- else
- event:FireServer("Input", "Crawl", true)
- humanoid.HipHeight = -2
- animTrackCrawl:Play(0.100000001, 1, 0)
- humanoid.WalkSpeed = 8
- end
- end
- if actionInputState == Enum.UserInputState.Begin then
- event:FireServer("Input", "Crawl", true)
- humanoid.HipHeight = -2
- animTrackCrawl:Play(0.100000001, 1, 0)
- humanoid.WalkSpeed = 8
- else
- if actionInputState == Enum.UserInputState.End then
- event:FireServer("Input", "Crawl", false)
- humanoid.HipHeight = 0
- animTrackCrawl:Stop()
- humanoid.WalkSpeed = 16
- end
- end
- end
- ActionFunction = function(actionName, actionInputState, actionInputObject)
- -- DECOMPILER ERROR at PC13: Unhandled construct in 'MakeBoolean' P1
- if actionInputState == Enum.UserInputState.Begin and onTrigger == true then
- event:FireServer("Input", "Action", true)
- playerStats.SetValue("ActionInput", true)
- end
- if actionInputState == Enum.UserInputState.End then
- event:FireServer("Input", "Action", false)
- end
- end
- SetupMobileButtons = function()
- if userInputService.TouchEnabled == true then
- player.PlayerGui:WaitForChild("TouchGui")
- local isSmallScreen = player.PlayerGui.TouchGui.TouchControlFrame.AbsoluteSize.Y <= 500
- local buttonSize = isSmallScreen and 70 or 120
- if isSmallScreen then
- if contextActionService:GetButton("Crawl") then
- contextActionService:SetPosition("Crawl", UDim2.new(1, -3 * buttonSize - 10, 1, -buttonSize - 20))
- end
- if contextActionService:GetButton("Action") then
- contextActionService:SetPosition("Action", UDim2.new(1, -2 * buttonSize - 10, 1, -buttonSize - 20))
- end
- else
- if contextActionService:GetButton("Crawl") then
- contextActionService:SetPosition("Crawl", UDim2.new(1, -2 * buttonSize - 10, 1, -buttonSize))
- end
- if contextActionService:GetButton("Action") then
- contextActionService:SetPosition("Action", UDim2.new(1, -2 * buttonSize - 10, 1, -2 * buttonSize + 20))
- end
- end
- end
- -- DECOMPILER ERROR: 7 unprocessed JMP targets
- end
- TriggerTouch = function(hit, touched, forceQuit)
- if forceQuit or playerStats.GetValue("DisableInteraction") == true then
- onTrigger = false
- actionBox.Visible = false
- actionBox.Text = ""
- event:FireServer("Input", "Trigger", false)
- else
- if string.match(hit.Name, "Trigger") and onTrigger ~= touched then
- onTrigger = touched
- if touched == false then
- progressBox.Visible = false
- else
- UpdateActionBox(hit:FindFirstChild("ActionSign").Value)
- spawn(function()
- local triggerActionSign = hit:FindFirstChild("ActionSign")
- local currentTriggerValue = triggerActionSign.Value
- while onTrigger == true do
- if currentTriggerValue ~= triggerActionSign.Value then
- currentTriggerValue = triggerActionSign.Value
- UpdateActionBox(currentTriggerValue)
- end
- wait()
- end
- actionBox.Visible = false
- actionBox.Text = ""
- end)
- end
- event:FireServer("Input", "Trigger", touched, hit:FindFirstChild("Event"))
- end
- end
- end
- UpdateActionBox = function(actionValue)
- if actionValue then
- actionBox.Visible = true
- if actionValue == 10 then
- actionBox.Text = "Open Door"
- else
- if actionValue == 11 then
- actionBox.Text = "Close Door"
- else
- if actionValue == 12 then
- if playerStats.GetValue("IsBeast") then
- actionBox.Visible = false
- actionBox.Text = ""
- else
- actionBox.Text = "Open Exit"
- end
- else
- if actionValue == 20 then
- if playerStats.GetValue("IsBeast") then
- actionBox.Visible = false
- actionBox.Text = ""
- else
- actionBox.Text = "Hack"
- end
- else
- if actionValue == 30 then
- if playerStats.GetValue("IsBeast") then
- if character:FindFirstChild("CarriedTorso").Value == nil then
- actionBox.Visible = false
- actionBox.Text = ""
- else
- actionBox.Text = "Trap"
- end
- else
- actionBox.Visible = false
- actionBox.Text = ""
- end
- else
- if actionValue == 31 then
- if playerStats.GetValue("IsBeast") then
- actionBox.Visible = false
- actionBox.Text = ""
- else
- actionBox.Text = "Free"
- end
- else
- actionBox.Visible = false
- actionBox.Text = ""
- end
- end
- end
- end
- end
- end
- end
- end
- event.OnClientEvent:connect(function(...)
- local tuple = {...}
- end)
- playerStats.Get("CurrentAnimation").Changed:connect(function()
- if playerStats.GetValue("CurrentAnimation") == "Typing" then
- trackTyping:Play(0.100000001, 1, 6)
- else
- if playerStats.GetValue("CurrentAnimation") == "Carry" then
- trackCarry:Play()
- else
- trackTyping:Stop()
- trackCarry:Stop()
- end
- end
- end)
- humanoid.Running:connect(function(speed)
- if speed > 0.5 then
- animTrackCrawl:AdjustSpeed(2)
- else
- animTrackCrawl:AdjustSpeed(0)
- end
- end)
- contextActionService:BindAction("Crawl, CrawlFunction, true, Enum.KeyCode.LeftShift, Enum.KeyCode.ButtonL2)
- contextActionService:SetTitle("Crawl, "C")
- contextActionService:BindAction("Action, ActionFunction, true, Enum.KeyCode.E, Enum.KeyCode.ButtonX)
- contextActionService:SetTitle("Action, "E")
- playerStats.Get("DisableCrawl").Changed:connect(function()
- if playerStats.GetValue("DisableCrawl") == true then
- event:FireServer("Input", "Crawl", false)
- humanoid.HipHeight = 0
- animTrackCrawl:Stop()
- humanoid.WalkSpeed = 16
- contextActionService:UnbindAction("Crawl")
- else
- contextActionService:BindAction("Crawl", CrawlFunction, true, Enum.KeyCode.LeftShift, Enum.KeyCode.ButtonL2)
- contextActionService:SetTitle("Crawl", "C")
- SetupMobileButtons()
- end
- end)
- playerStats.Get("DisableInteraction").Changed:connect(function()
- if playerStats.GetValue("DisableInteraction") == true then
- event:FireServer("Input", "Action", false)
- TriggerTouch(nil, false, true)
- contextActionService:UnbindAction("Action")
- else
- contextActionService:BindAction("Action", ActionFunction, true, Enum.KeyCode.E, Enum.KeyCode.ButtonX)
- contextActionService:SetTitle("Action", "E")
- SetupMobileButtons()
- end
- end)
- character.Torso.Touched:connect(function(hit)
- TriggerTouch(hit, true, false)
- end)
- character.Torso.TouchEnded:connect(function(hit)
- TriggerTouch(hit, false, false)
- end)
- playerStats.Get("Ragdoll").Changed:connect(function()
- if playerStats.GetValue("Ragdoll") == true then
- humanoid.JumpPower = 0
- else
- humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
- humanoid.JumpPower = 36
- end
- end)
- wait(1)
- SetupMobileButtons()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement