idk what am doing wrong in my script but when i buy smth it doest apply to me
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local adminEvent = ReplicatedStorage:WaitForChild("AdminAction")
adminEvent.OnServerEvent:Connect(function(player, action)
if action == "BanAll" then
for _, p in pairs(Players:GetPlayers()) do
if p ~= player then
p:Kick("You were banned by admin!")
end
end
elseif action == "FreezeAll" then
for _, p in pairs(Players:GetPlayers()) do
if p ~= player and p.Character and p.Character:FindFirstChildOfClass("Humanoid") then
local hum = p.Character:FindFirstChildOfClass("Humanoid")
hum.WalkSpeed = 0
hum.JumpPower = 0
task.delay(20, function()
if hum then
hum.WalkSpeed = 16
hum.JumpPower = 50
end
end)
end
end
elseif action == "PushAll" then
local root = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
local look = root and root.CFrame.LookVector or Vector3.new(0, 0, 1)
for _, p in pairs(Players:GetPlayers()) do
if p ~= player and p.Character and p.Character:FindFirstChild("HumanoidRootPart") then
p.Character.HumanoidRootPart.Velocity = look * 100
end
end
** You are now Level 4! **