View difference between Paste ID: VdHpjB9z and yHiev811
SHOW: | | - or go back to the newest paste.
1-
plr = game.Players.LocalPlayer
1+
-- This script has been converted to FE by iPxter
2
 
3
 
4
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
5
local Player,Mouse,mouse,UserInputService,ContextActionService = owner
6
do
7
    print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
8
    script.Parent = Player.Character
9
 
10
    --RemoteEvent for communicating
11
    local Event = Instance.new("RemoteEvent")
12
    Event.Name = "UserInput_Event"
13
 
14
    --Fake event to make stuff like Mouse.KeyDown work
15
    local function fakeEvent()
16
        local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
17
        t.connect = t.Connect
18
        return t
19
    end
20
 
21
    --Creating fake input objects with fake variables
22
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
23
    local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
24
    local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
25
        CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
26
    end}
27
    --Merged 2 functions into one by checking amount of arguments
28
    CAS.UnbindAction = CAS.BindAction
29
 
30
    --This function will trigger the events that have been :Connect()'ed
31
    local function te(self,ev,...)
32
        local t = m[ev]
33
        if t and t._fakeEvent and t.Function then
34
            t.Function(...)
35
        end
36
    end
37
    m.TrigEvent = te
38
    UIS.TrigEvent = te
39
 
40
    Event.OnServerEvent:Connect(function(plr,io)
41
        if plr~=Player then return end
42
        if io.isMouse then
43
            m.Target = io.Target
44
            m.Hit = io.Hit
45
        else
46
            local b = io.UserInputState == Enum.UserInputState.Begin
47
            if io.UserInputType == Enum.UserInputType.MouseButton1 then
48
                return m:TrigEvent(b and "Button1Down" or "Button1Up")
49
            end
50
            for _,t in pairs(CAS.Actions) do
51
                for _,k in pairs(t.Keys) do
52
                    if k==io.KeyCode then
53
                        t.Function(t.Name,io.UserInputState,io)
54
                    end
55
                end
56
            end
57
            m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
58
            UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
59
        end
60
    end)
61
    Event.Parent = NLS([==[
62
    local Player = game:GetService("Players").Rohan_Kishiba
63
    local Event = script:WaitForChild("UserInput_Event")
64
 
65
    local UIS = game:GetService("UserInputService")
66
    local input = function(io,a)
67
        if a then return end
68
        --Since InputObject is a client-side instance, we create and pass table instead
69
        Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
70
    end
71
    UIS.InputBegan:Connect(input)
72
    UIS.InputEnded:Connect(input)
73
 
74
    local Mouse = Player:GetMouse()
75
    local h,t
76
    --Give the server mouse data 30 times every second, but only if the values changed
77
    --If player is not moving their mouse, client won't fire events
78
    while wait(1/30) do
79
        if h~=Mouse.Hit or t~=Mouse.Target then
80
            h,t=Mouse.Hit,Mouse.Target
81
            Event:FireServer({isMouse=true,Target=t,Hit=h})
82
        end
83
    end]==],Player.Character)
84
    Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
85
end
86
87
plr = game.Players.Rohan_Kishiba
88
repeat wait() until plr.Character
89
char = plr.Character
90
91
-- Credit to shack for the anti death system
92
93
local BODY = {}
94
LeftArm = char["Left Arm"]
95
RightLeg = char["Right Leg"]
96
LeftLeg = char["Left Leg"]
97
for _, c in pairs(char:GetDescendants()) do
98
    if c:IsA("BasePart") and c.Name ~= "Handle" then
99
        if c ~= char.HumanoidRootPart and c ~= char.Torso and c ~= char.Head and c ~= char["Right Arm"] and c ~= LeftArm and c ~= RightLeg and c ~= LeftLeg then
100
            c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0)
101
        end
102
        table.insert(BODY,{c,c.Parent,c.Material,c.Color,c.Transparency})
103
    elseif c:IsA("JointInstance") then
104
        table.insert(BODY,{c,c.Parent,nil,nil,nil})
105
    end
106
end
107
for e = 1, #BODY do
108
    if BODY[e] ~= nil then
109
        local STUFF = BODY[e]
110
        local PART = STUFF[1]
111
        local PARENT = STUFF[2]
112
        local MATERIAL = STUFF[3]
113
        local COLOR = STUFF[4]
114
        local TRANSPARENCY = STUFF[5]
115
        if PART.ClassName == "Part" and PART ~= char.HumanoidRootPart then
116
            PART.Material = MATERIAL
117
            PART.Color = COLOR
118
            PART.Transparency = TRANSPARENCY
119
        end
120
        PART.AncestryChanged:Connect(function()
121
            PART.Parent = PARENT
122
        end)
123
    end
124
end
125
function refit()
126
   char.Parent = workspace
127
    for e = 1, #BODY do
128
        if BODY[e] ~= nil then
129
            local STUFF = BODY[e]
130
            local PART = STUFF[1]
131
            local PARENT = STUFF[2]
132
            local MATERIAL = STUFF[3]
133
            local COLOR = STUFF[4]
134
            local TRANSPARENCY = STUFF[5]
135
            if PART.ClassName == "Part" and PART ~= char.HumanoidRootPart then
136
                PART.Material = MATERIAL
137
                PART.Color = COLOR
138
                PART.Transparency = TRANSPARENCY
139
            end
140
            if PART.Parent ~= PARENT then
141
                char:FindFirstChildOfClass("Humanoid"):remove()
142
                PART.Parent = PARENT
143
                Humanoid = Instance.new("Humanoid",char)
144
            end
145
        end
146
    end
147
end
148
char.Humanoid.Died:connect(function()
149
	refit()
150
end)
151
local torso = Instance.new("SelectionBox",char)
152
torso.Adornee = char.Torso
153
local leftarm = Instance.new("SelectionBox",char)
154
leftarm.Adornee = LeftArm
155
local rightarm = Instance.new("SelectionBox",char)
156
rightarm.Adornee = char["Right Arm"]
157
local leftleg = Instance.new("SelectionBox",char)
158
leftleg.Adornee = LeftLeg
159
local rightleg = Instance.new("SelectionBox",char)
160
rightleg.Adornee = char["Right Leg"]
161
-- Color pallet
162
green = "Lime green"
163
red = "Really red"
164
blue = "Electric blue"
165
yellow = "New Yeller"
166
violet = "Pastel violet"
167
168
coroutine.wrap(function()
169
	  while true do
170
		wait(0.5)
171
		torso.Color3 = BrickColor.new(green).Color
172
		rightarm.Color3 = BrickColor.new(green).Color
173
		leftarm.Color3 = BrickColor.new(green).Color
174
		leftleg.Color3 = BrickColor.new(green).Color
175
		rightleg.Color3 = BrickColor.new(green).Color
176
		wait(0.5)
177
		torso.Color3 = BrickColor.new(red).Color
178
		rightarm.Color3 = BrickColor.new(red).Color
179
		leftarm.Color3 = BrickColor.new(red).Color
180
		leftleg.Color3 = BrickColor.new(red).Color
181
		rightleg.Color3 = BrickColor.new(red).Color
182
		wait(0.5)
183
		torso.Color3 = BrickColor.new(blue).Color
184
		rightarm.Color3 = BrickColor.new(blue).Color
185
		leftarm.Color3 = BrickColor.new(blue).Color
186
		leftleg.Color3 = BrickColor.new(blue).Color
187
		rightleg.Color3 = BrickColor.new(blue).Color
188
		wait(0.5)
189
		torso.Color3 = BrickColor.new(yellow).Color
190
		rightarm.Color3 = BrickColor.new(yellow).Color
191
		leftarm.Color3 = BrickColor.new(yellow).Color
192
		leftleg.Color3 = BrickColor.new(yellow).Color
193
		rightleg.Color3 = BrickColor.new(yellow).Color
194
		wait(0.5)
195
		torso.Color3 = BrickColor.new(violet).Color
196
		rightarm.Color3 = BrickColor.new(violet).Color
197
		leftarm.Color3 = BrickColor.new(violet).Color
198
		leftleg.Color3 = BrickColor.new(violet).Color
199
		rightleg.Color3 = BrickColor.new(violet).Color
200
	end
201
end)()
202
while true do
203
   wait()
204
   refit()
205
   char.Humanoid.Health = math.huge
206
   char.Humanoid.MaxHealth = math.huge
207
end