Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local functions = {}
- local runService = game:GetService("RunService")
- local uis = game:GetService("UserInputService")
- local mouse = game:GetService("Players")['LocalPlayer']:GetMouse()
- local keys = {}
- uis.InputBegan:Connect(function(k)
- keys[k.KeyCode] = true
- end)
- uis.InputEnded:Connect(function(k)
- keys[k.KeyCode] = false
- end)
- function functions:LocalPlayer()
- if runService:IsClient() then
- return game:GetService("Players").LocalPlayer
- end
- end;
- function functions:LocalCharacter()
- if runService:IsClient() then
- return game:GetService("Players").LocalPlayer.Character or false
- end
- return false
- end
- function functions:SetWalkSpeed(val)
- if runService:IsClient() then
- game:GetService("Players").LocalPlayer.Character.Humanoid.WalkSpeed = val
- return true
- end
- return false
- end
- function functions:SetJumpPower(val)
- if runService:IsClient() then
- game:GetService("Players").LocalPlayer.Character.Humanoid.JumpPower = val
- return true
- end
- return false
- end
- function functions:MouseButton1Down()
- if runService:IsClient() then
- for i , v in pairs(uis:GetMouseButtonsPressed()) do
- if v == Enum.UserInputType.MouseButton1 then
- return true
- end
- end
- end
- return false
- end
- function functions:MouseButton2Down()
- if runService:IsClient() then
- for i , v in pairs(uis:GetMouseButtonsPressed()) do
- if v == Enum.UserInputType.MouseButton2 then
- return true
- end
- end
- end
- return false
- end
- function functions:MouseButton3Down()
- if runService:IsClient() then
- for i , v in pairs(uis:GetMouseButtonsPressed()) do
- if v == Enum.UserInputType.MouseButton3 then
- return true
- end
- end
- end
- return false
- end
- function functions:IsKeyDown(key)
- if runService:IsClient() then
- if key then
- return keys[key] or false
- else
- return false
- end
- end
- end
- function functions:CreateRemoteEvent(name,parent)
- local remote = Instance.new('RemoteEvent')
- remote.Name = name
- remote.Parent = parent or game.ReplicatedStorage
- return remote
- end
- function functions:CreateRemoteFunction(name,parent)
- local remote = Instance.new('RemoteFunction')
- remote.Name = name
- remote.Parent = parent or game.ReplicatedStorage
- return remote
- end
- function functions:CreateBindableEvent(name,parent)
- local remote = Instance.new('BindableEvent')
- remote.Name = name
- remote.Parent = parent or game.ReplicatedStorage
- return remote
- end
- function functions:CreateBindableFunction(name,parent)
- local remote = Instance.new('BindableFunction')
- remote.Name = name
- remote.Parent = parent or game.ReplicatedStorage
- return remote
- end
- function functions:ShakeCamera(times)
- if runService:IsClient() then
- if times then
- for i = 0 , times do
- local x = math.random(-100,100)/100
- local y = math.random(-100,100)/100
- local z = math.random(-100,100)/100
- game:GetService("Players").LocalPlayer.Character.Humanoid.CameraOffset = Vector3.new(x,y,z)
- wait(.1)
- end
- game:GetService("Players").LocalPlayer.Character.Humanoid.CameraOffset = Vector3.new(0,0,0)
- else
- local x = math.random(-100,100)/100
- local y = math.random(-100,100)/100
- local z = math.random(-100,100)/100
- game:GetService("Players").LocalPlayer.Character.Humanoid.CameraOffset = Vector3.new(x,y,z)
- wait(.1)
- game:GetService("Players").LocalPlayer.Character.Humanoid.CameraOffset = Vector3.new(0,0,0)
- end
- return true
- end
- return false
- end
- return functions
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement