Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Instructions:
- --[[
- Any local variables with :
- = LocalPlayer:
- Must be replaced with "owner". So if your local variable is game.Players.LocalPlayer , replace it with owner
- = :GetMouse():
- Remove the variable entirely.
- then paste this over the desired script
- --]]
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
- script.Parent = Player.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- -- End of FE converter
- print("Q for better accuracy of being a vending machine")
- local qKey = false
- local char = owner.Character
- if char then
- if char.Humanoid.RigType==Enum.HumanoidRigType.R6 then
- if char:FindFirstChildWhichIsA("BillboardGui",true) then
- else
- local bil = Instance.new("BillboardGui",char.Head)
- local TL = Instance.new("TextLabel",bil)
- bil.ExtentsOffsetWorldSpace = Vector3.new(0,5,0)
- bil.Size = UDim2.new({0, 200},{0, 200})
- bil.MaxDistance = 32
- TL.BackgroundTransparency = 1
- TL.TextScaled = true
- TL.Text = "Click a button for a snack."
- TL.TextColor3 = Color3.fromRGB(255, 255, 255)
- TL.Font = Enum.Font.Cartoon
- TL.Size = UDim2.new(0, 200,0, 200)
- bil.Size = UDim2.new(0, 200,0, 200)
- end
- local cCh = char:GetChildren()
- local part = Instance.new("Part",char)
- part.CanCollide = false
- part.Anchored = false
- part.Size = Vector3.new(.5,1,.1)
- part.CFrame = CFrame.new(char.Torso.Position) * CFrame.Angles(math.rad(char.Torso.Orientation.X),math.rad(char.Torso.Orientation.Y),math.rad(char.Torso.Orientation.Z)) * CFrame.new(-.75,.5,-.5)
- local weld = Instance.new("WeldConstraint",part)
- weld.Part1 = part
- weld.Part0 = char.Torso
- local part1 = Instance.new("Part",char)
- part1.CanCollide = false
- part1.Anchored = false
- part1.Size = Vector3.new(.4,.4,.1)
- part1.CFrame = CFrame.new(char.Torso.Position) * CFrame.Angles(math.rad(char.Torso.Orientation.X),math.rad(char.Torso.Orientation.Y),math.rad(char.Torso.Orientation.Z)) * CFrame.new(-.75,.75,-.55)
- part1.BrickColor = BrickColor.new("Really red")
- local weld1 = Instance.new("WeldConstraint",part)
- weld1.Part1 = part
- weld1.Part0 = part1
- local part2 = Instance.new("Part",char)
- part2.CanCollide = false
- part2.Anchored = false
- part2.Size = Vector3.new(.4,.4,.1)
- part2.CFrame = CFrame.new(char.Torso.Position) * CFrame.Angles(math.rad(char.Torso.Orientation.X),math.rad(char.Torso.Orientation.Y),math.rad(char.Torso.Orientation.Z)) * CFrame.new(-.75,.25,-.55)
- part2.BrickColor = BrickColor.new("Really red")
- local weld2 = Instance.new("WeldConstraint",part)
- weld2.Part1 = part
- weld2.Part0 = part2
- if char:FindFirstChildWhichIsA("Shirt") then
- char:FindFirstChildWhichIsA("Shirt"):Destroy()
- end
- if char:FindFirstChildWhichIsA("Pants") then
- char:FindFirstChildWhichIsA("Pants").PantsTemplate = "rbxassetid://2737266197"
- else
- local pants = Instance.new("Pants",char)
- pants.PantsTemplate = "rbxassetid://2737266197"
- end
- if char:FindFirstChildWhichIsA("ShirtGraphic") then
- char:FindFirstChildWhichIsA("ShirtGraphic"):Destroy()
- end
- for i=1, #cCh do
- if cCh[i]:IsA("CharacterMesh") then
- cCh[i]:Destroy()
- end
- end
- mouse.KeyDown:Connect(function(key)
- if key=="q" then
- if qKey==false then
- for i=1, #cCh do
- if cCh[i].Name=="Left Arm" or cCh[i].Name=="Right Arm" or cCh[i].Name=="Head" then
- cCh[i].Transparency = 1
- elseif cCh[i]:IsA("Accessory") then
- cCh[i].Handle.Transparency = 1
- end
- end
- char.Head.face.Transparency = 1
- local bil = char.Head:FindFirstChildWhichIsA("BillboardGui")
- bil.PlayerToHideFrom = owner
- if bil.TextLabel.Text=="Click a button for a snack." then
- else
- bil.TextLabel.Text="Click a button for a snack."
- end
- qKey = true
- else
- for i=1, #cCh do
- if cCh[i].Name=="Left Arm" or cCh[i].Name=="Right Arm" or cCh[i].Name=="Head" then
- cCh[i].Transparency = 0
- elseif cCh[i]:IsA("Accessory") then
- cCh[i].Handle.Transparency = 0
- end
- end
- local bil = char.Head:FindFirstChildWhichIsA("BillboardGui")
- char.Head.face.Transparency = 0
- bil.PlayerToHideFrom = nil
- qKey = false
- end
- end
- end)
- char["Body Colors"].LeftArmColor = BrickColor.new("Dark stone grey")
- char["Body Colors"].RightArmColor = BrickColor.new("Dark stone grey")
- local CD = Instance.new("ClickDetector",part1)
- CD.MouseClick:Connect(function(play)
- local tool = Instance.new("Tool",play.Character)
- tool.CanBeDropped = false
- tool.Name = "Sprite Cranberry"
- local part = Instance.new("Part")
- part.Name = "Handle"
- part.Parent = tool
- part.Size = Vector3.new(2,1,2)
- local mesh = Instance.new("SpecialMesh",part)
- mesh.MeshId = "rbxassetid://2605745921"
- mesh.TextureId = "rbxassetid://2605745951"
- mesh.Scale = Vector3.new(1,1,1)
- end)
- local CD2 = Instance.new("ClickDetector",part2)
- CD2.MouseClick:Connect(function(play)
- local tool2 = Instance.new("Tool",play.Character)
- tool2.CanBeDropped = false
- tool2.Name = "Chips"
- local han2 = Instance.new("Part")
- han2.Name = "Handle"
- han2.Parent = tool2
- han2.Size = Vector3.new(2,1,2)
- local mesh2 = Instance.new("SpecialMesh",han2)
- mesh2.MeshId = "rbxassetid://431009042"
- mesh2.TextureId = "rbxassetid://431009057"
- mesh2.Scale = Vector3.new(.1,.1,.1)
- end)
- while true do
- owner.Character.Humanoid.Health = "inf"
- owner.Character.Humanoid.PlatformStand = false
- owner.Character.Humanoid.WalkSpeed = 16
- owner.Character.Humanoid.JumpPower = 50
- owner.Character.Humanoid.MaxHealth = "inf"
- wait(.5)
- end
- else
- print("You need to be R6.")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement