Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait(1)
- local Player = game:GetService("Players"):WaitForChild('jesseanwa08')
- local Mouse,mouse,UserInputService,ContextActionService
- local camcf = CFrame.new()
- do
- local CAS = {Actions={}}
- local Event = Instance.new("RemoteEvent")
- Event.Name = Player.UserId
- Event.Parent = workspace:FindFirstChildOfClass'Terrain'
- local fakeEvent = function()
- local t = {_fakeEvent=true}
- t.Connect = function(self,f)self.Function=f end
- t.connect = t.Connect
- return t
- end
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- function CAS:BindAction(name,fun,touch,...)
- CAS.Actions[name] = {Name=name,Function=fun,Keys={...}}
- end
- function CAS:UnbindAction(name)
- CAS.Actions[name] = nil
- end
- 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,type,value)
- if plr~=Player then return end
- if type == 1 or type == nil then
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- elseif io.UserInputType == Enum.UserInputType.MouseButton1 then
- if io.UserInputState == Enum.UserInputState.Begin then
- m:TrigEvent("Button1Down")
- else
- m:TrigEvent("Button1Up")
- end
- else
- for n,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
- if io.UserInputState == Enum.UserInputState.Begin then
- m:TrigEvent("KeyDown",io.KeyCode.Name:lower())
- UIS:TrigEvent("InputBegan",io,false)
- else
- m:TrigEvent("KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent("InputEnded",io,false)
- end
- end
- elseif type == 2 then
- camcf = value
- end
- end)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- workspace:FindFirstChildOfClass'Terrain'.ChildRemoved:Connect(function(ch)
- if ch.Name == Player.UserId then
- Event = Instance.new("RemoteEvent")
- Event.Name = Player.UserId
- Event.Parent = workspace:FindFirstChildOfClass('Terrain')
- Event.OnServerEvent:Connect(function(plr,io,type,value)
- if plr~=Player then return end
- if type == 1 or type == nil then
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- elseif io.UserInputType == Enum.UserInputType.MouseButton1 then
- if io.UserInputState == Enum.UserInputState.Begin then
- m:TrigEvent("Button1Down")
- else
- m:TrigEvent("Button1Up")
- end
- else
- for n,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
- if io.UserInputState == Enum.UserInputState.Begin then
- m:TrigEvent("KeyDown",io.KeyCode.Name:lower())
- UIS:TrigEvent("InputBegan",io,false)
- else
- m:TrigEvent("KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent("InputEnded",io,false)
- end
- end
- elseif type == 2 then
- camcf = value
- end
- end)
- end
- end)
- end
- wait(2)
- script.Parent = nil
- function addatt(prt)
- if script:FindFirstChild(prt.Name) then
- local p = script:FindFirstChild(prt.Name)
- if p then
- for i,v in pairs(p:children()) do
- v:Clone().Parent = prt
- end
- end
- end
- end
- local character = Instance.new("Model")
- local la = Instance.new("FlagStand")
- local ra = Instance.new("FlagStand")
- local ll = Instance.new("FlagStand")
- local rl = Instance.new("FlagStand")
- local hd = Instance.new("FlagStand")
- local tr = Instance.new("FlagStand")
- local hum = Instance.new("Humanoid")
- local hrp = Instance.new("FlagStand")
- local face = Instance.new("Decal")
- local inpcl = script:WaitForChild("LocalScript"):Clone()
- game:GetService("Debris"):AddItem(script:WaitForChild("LocalScript"),0)
- local inpo = inpcl:Clone()
- function ream(are)
- if are:FindFirstChild'Char' then
- local value = are:FindFirstChild'Char'
- value.Value = hd
- end
- end
- face.Parent = hd
- face.Texture = "rbxasset://textures/face.png"
- local msh = Instance.new("SpecialMesh")
- msh.Scale = Vector3.new(1.25,1.25,1.25)
- msh.Parent = hd
- hum.Parent = character
- hum.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
- character.Parent = workspace:FindFirstChildOfClass("Terrain")
- hrp.Anchored = true
- hrp.Size = Vector3.new(2,2,1)
- hrp.Name = "HumanoidRootPart"
- hrp.Parent = character
- hrp.Transparency = 1
- la.Anchored = true
- ra.Anchored = true
- ll.Anchored = true
- rl.Anchored = true
- hd.Anchored = true
- tr.Anchored = true
- la.Name = "Left Arm"
- ra.Name = "Right Arm"
- ll.Name = "Left Leg"
- rl.Name = "Right Leg"
- tr.Name = "Torso"
- hd.Name = "Head"
- la.Size = Vector3.new(1,2,1)
- ra.Size = Vector3.new(1,2,1)
- ll.Size = Vector3.new(1,2,1)
- rl.Size = Vector3.new(1,2,1)
- hd.Size = Vector3.new(2,1,1)
- tr.Size = Vector3.new(2,2,1)
- la.Parent = character
- ra.Parent = character
- ll.Parent = character
- rl.Parent = character
- hd.Parent = character
- tr.Parent = character
- addatt(la)
- addatt(ra)
- addatt(ll)
- addatt(rl)
- addatt(tr)
- addatt(hd)
- addatt(hrp)
- local lacf= CFrame.new(-1.5,0,0)
- local racf = CFrame.new(1.5,0,0)
- local llcf = CFrame.new(-.5,-2,0)
- local rlcf = CFrame.new(.5,-2,0)
- local hdcf = CFrame.new(0,1.5,0)
- local trcf = CFrame.new(0,0,0)*CFrame.Angles(0,math.rad(180),0)
- local posy = CFrame.new(0,8,0)
- local move = CFrame.new()
- local fsp = 0
- function ay(h,a)
- trcf = trcf:lerp(h[1],(tonumber(a) or .3))
- hdcf = hdcf:lerp(h[2],(tonumber(a) or .3))
- lacf = lacf:lerp(h[3],(tonumber(a) or .3))
- racf = racf:lerp(h[4],(tonumber(a) or .3))
- llcf = llcf:lerp(h[5],(tonumber(a) or .3))
- rlcf = rlcf:lerp(h[6],(tonumber(a) or .3))
- end
- local r = Instance.new("BindableEvent")
- r.Parent = script
- local remdel
- function remove()
- remdel:Disconnect()
- remdel = nil
- game:GetService("Debris"):AddItem(character,0)
- end
- remdel = character.ChildRemoved:Connect(remove)
- function recreate()
- character = Instance.new("Model")
- la = Instance.new("FlagStand")
- ra = Instance.new("FlagStand")
- ll = Instance.new("FlagStand")
- rl = Instance.new("FlagStand")
- hd = Instance.new("FlagStand")
- tr = Instance.new("FlagStand")
- hum = Instance.new("Humanoid")
- hrp = Instance.new("FlagStand")
- face = Instance.new("Decal")
- face.Parent = hd
- face.Texture = "rbxasset://textures/face.png"
- msh = Instance.new("SpecialMesh")
- msh.Scale = Vector3.new(1.25,1.25,1.25)
- msh.Parent = hd
- hum.Parent = character
- hum.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
- character.Parent = workspace:FindFirstChildOfClass("Terrain")
- hrp.Anchored = true
- hrp.Size = Vector3.new(2,2,1)
- hrp.Name = "HumanoidRootPart"
- hrp.Parent = character
- hrp.Transparency = 1
- la.Anchored = true
- ra.Anchored = true
- ll.Anchored = true
- rl.Anchored = true
- hd.Anchored = true
- tr.Anchored = true
- la.Name = "Left Arm"
- ra.Name = "Right Arm"
- ll.Name = "Left Leg"
- rl.Name = "Right Leg"
- tr.Name = "Torso"
- hd.Name = "Head"
- la.Size = Vector3.new(1,2,1)
- ra.Size = Vector3.new(1,2,1)
- ll.Size = Vector3.new(1,2,1)
- rl.Size = Vector3.new(1,2,1)
- hd.Size = Vector3.new(2,1,1)
- tr.Size = Vector3.new(2,2,1)
- la.Parent = character
- ra.Parent = character
- ll.Parent = character
- rl.Parent = character
- hd.Parent = character
- tr.Parent = character
- addatt(la)
- addatt(ra)
- addatt(ll)
- addatt(rl)
- addatt(tr)
- addatt(hd)
- addatt(hrp)
- remdel = character.ChildRemoved:Connect(remove)
- end
- function sw(n)
- n = tonumber(n)
- if n then
- for i = 0,n,.1 do
- r.Event:wait()
- end
- else
- r.Event:wait()
- end
- end
- speed = 2
- w,s,a,d = false,false,false,false
- mouse.KeyDown:Connect(function(key)
- if key == 'w' then
- w = true
- end
- if key == 's' then
- s = true
- end
- if key == 'a' then
- a = true
- end
- if key == 'd' then
- d = true
- end
- end)
- mouse.KeyUp:Connect(function(key)
- if key == 'w' then
- w = false
- end
- if key == 's' then
- s = false
- end
- if key == 'a' then
- a = false
- end
- if key == 'd' then
- d = false
- end
- end)
- function checkchar()
- if character.Parent ~= workspace:FindFirstChildOfClass('Terrain') then
- local success,detail = pcall(function()
- character.Parent = workspace:FindFirstChildOfClass('Terrain')
- end)
- if not success then
- recreate()
- end
- end
- end
- inpo.Parent = Player.PlayerGui
- inpo.Disabled = false
- ream(inpo)
- game:GetService("RunService").Heartbeat:Connect(function()
- checkchar()
- if Player.PlayerGui:FindFirstChild'LocalScript' == nil then
- inpo = inpcl:clone()
- inpo.Parent = Player.PlayerGui
- inpo.Disabled = false
- end
- tr.CFrame = posy * trcf
- la.CFrame = tr.CFrame * lacf
- ra.CFrame = tr.CFrame * racf
- ll.CFrame = tr.CFrame * llcf
- rl.CFrame = tr.CFrame * rlcf
- hd.CFrame = tr.CFrame * hdcf
- hrp.CFrame = posy
- local ray = Ray.new(posy.p,CFrame.new(0,-1,0).p.unit*4)
- local pos,hit = workspace:FindPartOnRayWithIgnoreList(ray,{character})
- if pos then
- fsp = 0
- posy = posy * CFrame.new(0,hit.y-posy.y+3,0)
- else
- fsp = fsp + .06
- posy = posy - Vector3.new(0,fsp,0)
- end
- if w or s or a or d then
- posy = CFrame.new(posy.Position,Vector3.new(camcf.X,posy.Y,camcf.Z))
- end
- local oldp = posy
- if w then
- posy = posy * CFrame.new(0,0,-speed)
- end
- if s then
- posy = posy * CFrame.new(0,0,speed)
- end
- if a then
- posy = posy * CFrame.new(-speed,0,0)
- end
- if d then
- posy = posy * CFrame.new(speed,0,0)
- end
- if posy.X ~= oldp.X or posy.Z ~= oldp.Z then
- posy = CFrame.new(posy.Position,oldp.Position)
- end
- if Player.Character then
- game:GetService("Debris"):AddItem(Player.Character,0)
- end
- ream(inpo)
- end)
- game:GetService("RunService").Stepped:Connect(function()
- tr.CFrame = posy * trcf
- la.CFrame = tr.CFrame * lacf
- ra.CFrame = tr.CFrame * racf
- ll.CFrame = tr.CFrame * llcf
- rl.CFrame = tr.CFrame * rlcf
- hd.CFrame = tr.CFrame * hdcf
- hrp.CFrame = posy
- r:Fire()
- if Player.Character then
- game:GetService("Debris"):AddItem(Player.Character,0)
- end
- ream(inpo)
- end)
Add Comment
Please, Sign In to add comment