Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This script has been converted to FE by iPxter
- 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
- --Script Builder Radio!
- local Player = owner
- local c = Player.Character
- if not c or not c.Parent then
- c = Player.CharacterAdded:wait()
- end
- wait(1)
- local radio = Instance.new("Part",c)
- radio.Name = "Radio"
- radio.CanCollide = false
- radio.Anchored = true
- radio.FormFactor = "Custom"
- radio.Size = Vector3.new(3.2, 1.43, 0.8)
- radio.CFrame = c.Torso.CFrame * CFrame.new(0,0,.8)
- radio.CFrame = radio.CFrame * CFrame.fromEulerAnglesXYZ(0,3.15,0)
- radio.CFrame = radio.CFrame * CFrame.fromEulerAnglesXYZ(0,0,-.7)
- local mesh = Instance.new("SpecialMesh",radio)
- mesh.MeshId = "http://www.roblox.com/asset/?id=151760030"
- mesh.TextureId = "https://www.roblox.com/Sweg-item?id=156708131"
- local weld = Instance.new("Weld",radio)
- weld.Part0 = c.Torso
- weld.Part1 = radio
- weld.C0 = c.Torso.CFrame:inverse()
- weld.C1 = radio.CFrame:inverse()
- radio.Anchored = false
- local sound = Instance.new("Sound",radio)
- sound.Name = "Music"
- sound.Looped = true
- sound.Volume = 1
- local gui = Instance.new("ScreenGui",Player.PlayerGui)
- local frame = Instance.new("Frame",gui)
- frame.BackgroundColor3 = Color3.new(58/255,58/255,58/255)
- frame.BorderColor3 = Color3.new(0,0,0)
- frame.BorderSizePixel = 2
- frame.Size = UDim2.new(0,300,0,200)
- frame.Position = UDim2.new(0,20,.5,-100)
- local playb = Instance.new("TextButton",frame)
- playb.BackgroundColor3 = Color3.new(0,85/255,0)
- playb.BorderColor3 = Color3.new(0,0,0)
- playb.BorderSizePixel = 2
- playb.Size = UDim2.new(.3,0,.2,0)
- playb.Position = UDim2.new(.1,0,.7,0)
- playb.Text = "Play"
- playb.TextColor3 = Color3.new(255,255,255)
- playb.TextScaled = true
- local stopb = Instance.new("TextButton",frame)
- stopb.BackgroundColor3 = Color3.new(170/255,0,0)
- stopb.BorderColor3 = Color3.new(0,0,0)
- stopb.BorderSizePixel = 2
- stopb.Size = UDim2.new(.3,0,.2,0)
- stopb.Position = UDim2.new(.6,0,.7,0)
- stopb.Text = "Stop"
- stopb.TextColor3 = Color3.new(255,255,255)
- stopb.TextScaled = true
- local stipb = Instance.new("TextBox",frame)
- stipb.BackgroundColor3 = Color3.new(0,0,127/255)
- stipb.BorderColor3 = Color3.new(0,0,0)
- stipb.BorderSizePixel = 2
- stipb:TweenSize(UDim2.new(.5,0,.25,0),"Out","Quad",1,true)
- stipb.Position = UDim2.new(.25,0,.3,0)
- stipb.Text = "SoundId"
- stipb.TextColor3 = Color3.new(255,255,255)
- stipb.TextScaled = true
- local label = Instance.new("TextLabel",frame)
- label.Text = "Made By naser2018!"
- label.TextScaled = true
- label:TweenSize(UDim2.new(1,0,.2,0))
- label.TextColor3 = Color3.new(255,255,255)
- label.BackgroundTransparency = 1
- --stipb.Size = UDim2.new(1,0,.2,0)
- local Playing = false
- stipb.Changed:connect(function()
- sound.SoundId = "rbxassetid://" .. stipb.Text
- end)
- playb.MouseButton1Click:connect(function()
- sound:Play()
- Playing = true
- end)
- stopb.MouseButton1Click:connect(function()
- sound:Stop()
- Playing = false
- end)
- while true do
- if Playing then
- mesh.Scale = Vector3.new(1.1,1.1,1.1)
- wait(.2)
- mesh.Scale = Vector3.new(1,1,1)
- end
- wait(.2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement