im trying to make a plugin for adonis where you can just stop player movement and its not really working
I dont know whats really wrong with it, I know there is a part that does nothing but i thought it would make for a piece that allows affects on other players, I dont have a vid or a screenshot sadly.
I tried checking with the ai generation but it reccomended me one but it didnt work for me sadly. I couldnt find stuff too simillar
I just need a little fixes thats all
Heres the code:
server = nil
service = nil
server.Commands.ExampleCommand = {
Prefix = server.Settings.Prefix; -- Prefix to use for command
Commands = {"troll"}; -- Command triggers
Description = "jacobs secret custom tool";
Hidden = false;
Fun = true;
AdminLevel = "Player";
Function = function(plr, args)
for _, players in pairs(service.GetPlayers(plr)) do
for i=1 ,0,-1 do
repeat wait() until plr.Character ~= nil
wait(1)
if plr.Character then
local humanoid = plr.Character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.Walkspeed = 0
humanoid.JumpPower = 0
else
warn("No Humanoid found in character")
end
else
warn("No character found for player")
end
end
end
end
}