Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --I took this snippet from a big project of mine so don’t mind the large amount of variables that I’ve used.
- local Players = game:GetService("Players")
- local NetworkClient = game:GetService("NetworkClient");
- local FindFirstChildWhichIsA; FindFirstChildWhichIsA = game["FindFirstChildWhichIsA"]
- local NetworkReplicator = FindFirstChildWhichIsA(NetworkClient, "NetworkReplicator");
- local WaitForChildWhichIsA; WaitForChildWhichIsA = function(self, string: string)
- local success, response = pcall(FindFirstChildWhichIsA, self, string);
- if not success or not response then
- repeat
- wait()
- success, response = pcall(FindFirstChildWhichIsA, self, string)
- until success and response and typeof(response) == "Instance"
- end
- return response;
- end
- local LocalPlayer = NetworkReplicator:GetPlayer()
- local OnCharacterAdded; OnCharacterAdded = function(Character)
- local Humanoid: Humanoid = WaitForChildWhichIsA(Character, "Humanoid");
- local RootPart: BasePart = Humanoid.RootPart;
- Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false);
- end;
- coroutine.wrap(pcall)(function()
- OnCharacterAdded(LocalPlayer.Character)
- end)
- LocalPlayer.CharacterAdded:Connect(OnCharacterAdded)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement