Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- 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
- function wbtwe(Part0, Part1, C0)
- local weld = Instance.new("Weld", Part0)
- weld.Part0 = Part0
- weld.Part1 = Part1
- weld.C0 = Part1.CFrame:inverse() *Part1.CFrame *C0
- return weld
- end
- function setweld(Weld, C0)
- Weld.C0 = Weld.Part1.CFrame:inverse() *Weld.Part1.CFrame *C0
- end
- law = wbtwe(owner.Character["Left Arm"], owner.Character.Torso, CFrame.new(1.49, 0.9, 0) *CFrame.Angles(0, 25, 0.7))
- raw = wbtwe(owner.Character["Right Arm"], owner.Character.Torso, CFrame.new(-1.49, 0, 0) *CFrame.Angles(0, 0, 0))
- local Fire = Instance.new("Fire")
- local Part = Instance.new("Part")
- local Position = "betarm"
- local Ground = Instance.new("Tool", owner.Backpack)
- Ground.Name = "Ground"
- local Rock = Instance.new("Tool", owner.Backpack)
- Rock.Name = "Rock"
- local FireT = Instance.new("Tool", owner.Backpack)
- FireT.Name = "Magma"
- local Water = Instance.new("Tool", owner.Backpack)
- Water.Name = "Water"
- local Ice = Instance.new("Tool", owner.Backpack)
- Ice.Name = "Ice"
- local Air = Instance.new("Tool", owner.Backpack)
- Air.Name = "Air"
- local Electricity = Instance.new("Tool", owner.Backpack)
- Electricity.Name = "Electricity"
- local Removal = Instance.new("Tool", owner.Backpack)
- Removal.Name = "Removal"
- local Music = Instance.new("Sound", owner.Character.Head)
- Music.SoundId = "rbxassetid://3045884359"
- Music.Volume = 0.5
- Music.Looped = true
- Music:Play()
- local Bass = Instance.new("Sound", owner.Character.Head)
- Bass.SoundId = "rbxasset://Sounds/bass.wav"
- Bass.Volume = 1
- local Active = false
- Part.CFrame = CFrame.new(-55.0303,0.71,26.6604,1,0,0,0,1,0,0,0,1)
- Part.TopSurface = Enum.SurfaceType.Smooth
- Part.Color = Color3.new(0.6235,0.6314,0.6745)
- Part.Material = Enum.Material.Glass
- Part.CanCollide = false
- Part.Size = Vector3.new(1.42,1.42,1.42)
- Part.BottomSurface = Enum.SurfaceType.Smooth
- Part.Reflectance = 2
- Part.Shape = Enum.PartType.Ball
- Part.Parent = owner.Character
- Fire.Enabled = false
- Fire.Size = 4
- Fire.Parent = Part
- orb = wbtwe(Part, owner.Character.Torso, CFrame.new(1.49, 0.1, 0) *CFrame.Angles(0, 0, -0.1))
- spawn(function()
- while game:GetService("RunService").Stepped:wait() do
- if Position == "betarm" then
- setweld(law, CFrame.new(1.49, 0.9, 0) *CFrame.Angles(0, 25, 0.7))
- setweld(raw, CFrame.new(-1.49, 0, 0) *CFrame.Angles(0, 0, 0))
- setweld(orb, CFrame.new(1.49, 0.1, 0) *CFrame.Angles(0, 0, -0.1))
- end
- if Position == "magichold" then
- setweld(law, CFrame.new(1.49, 0.5, 0) *CFrame.Angles(-0.9, 25, 0.1))
- setweld(raw, CFrame.new(-1.49, 0.5, 0) *CFrame.Angles(-0.9, 0, 0))
- setweld(orb, CFrame.new(0, 0.4, 1.4) *CFrame.Angles(0, 0, -0.1))
- end
- if Ground.Parent == owner.Character then
- Part.Material = Enum.Material.Grass
- Part.BrickColor = BrickColor.new("Bright green")
- Part.Reflectance = 0
- Position = "betarm"
- end
- if Water.Parent == owner.Character then
- Part.Material = Enum.Material.Glass
- Part.BrickColor = BrickColor.new("Deep blue")
- Part.Reflectance = 0
- Position = "magichold"
- end
- if Ice.Parent == owner.Character then
- Part.Material = Enum.Material.Ice
- Part.BrickColor = BrickColor.new("Medium blue")
- Part.Reflectance = 0
- Position = "betarm"
- end
- if Rock.Parent == owner.Character then
- Part.Material = Enum.Material.Slate
- Part.BrickColor = BrickColor.new("Medium stone grey")
- Part.Reflectance = 0
- Position = "betarm"
- end
- if Air.Parent == owner.Character then
- Part.Material = Enum.Material.Glass
- Part.BrickColor = BrickColor.new("Medium stone grey")
- Part.Reflectance = 2
- Part.Transparency = 0.5
- Position = "magichold"
- end
- if Electricity.Parent == owner.Character then
- Part.Material = Enum.Material.Neon
- Part.BrickColor = BrickColor.new("Cyan")
- Part.Reflectance = 2
- Part.Transparency = 0.5
- Position = "magichold"
- Fire.Enabled = true
- end
- if Removal.Parent == owner.Character then
- Part.Material = Enum.Material.Neon
- Part.BrickColor = BrickColor.new("Really red")
- Part.Reflectance = 2
- Part.Transparency = 0.5
- Position = "magichold"
- Fire.Enabled = true
- end
- if FireT.Parent == owner.Character then
- Part.Material = Enum.Material.Pebble
- Part.BrickColor = BrickColor.new("Smoky grey")
- Position = "magichold"
- if owner.Character.HumanoidRootPart.Velocity.Magnitude > 1 then
- Fire.Enabled = true
- else
- Fire.Enabled = true
- end
- else
- Fire.Enabled = false
- end
- if owner.Character:FindFirstChildOfClass("Tool") == nil then
- Part.Transparency = 0
- Part.Material = Enum.Material.Glass
- Part.Reflectance = 2
- Part.Color = Color3.new(0.6235,0.6314,0.6745)
- Position = "betarm"
- else
- Part.Transparency = 0
- end
- end
- end)
- mouse.Button1Down:connect(function()
- Active = true
- Bass:Play()
- end)
- mouse.Button1Up:connect(function()
- Active = false
- end)
- spawn(function()
- while game:GetService("RunService").Stepped:wait() do
- if Active == true then
- if Ground.Parent == owner.Character then
- workspace.Terrain:FillBall(mouse.Hit.p, 3, Enum.Material.Grass)
- end
- if Removal.Parent == owner.Character then
- workspace.Terrain:FillBall(mouse.Hit.p, 9, Enum.Material.Air)
- end
- if Ice.Parent == owner.Character then
- workspace.Terrain:FillBall(mouse.Hit.p, 3, Enum.Material.Glacier)
- end
- if FireT.Parent == owner.Character then
- workspace.Terrain:FillBall(mouse.Hit.p, 3, Enum.Material.CrackedLava)
- end
- if Water.Parent == owner.Character then
- workspace.Terrain:FillBall(mouse.Hit.p, 9, Enum.Material.Water)
- end
- if Rock.Parent == owner.Character then
- workspace.Terrain:FillBall(mouse.Hit.p, 3, Enum.Material.Rock)
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement