I have two scripts but with one I have a problem with. Local script:
kick.MouseButton1Click:Connect(function() if ParseTarget then game.ReplicatedStorage.AdminFireEvent:FireServer(LocalPlayer, "Kick", ParseTarget, reason) end end) --[[ kick is the button to kick a player, ParseTarget is the inputted target, reason is the inputted reason and LocalPlayer is the localplayer defined. --]]
Script in serverscriptservice:
game.ReplicatedStorage.AdminFireEvent.OnServerEvent:Connect(function(LocalPlayer, ActionType, ParseTarget, reason) if not ParseAdmin(LocalPlayer) then LocalPlayer:Kick("Unauthorized Admin Access") elseif ParseAdmin(LocalPlayer) then print("player is admin") if ActionType == "Kick" then print("kick successfully received"..reason) end end end) --[[ ParseAdmin is a function that itterates through a table of userids (admins) and ensure the player is one --]]
However, I do not get a print receiving kick, though I do get a print for player is admin. I'm unsuure what's wrong, please help me.
I don't think you need the "LocalPlayer" in line 3 of you localscript, I'm pretty sure when you fire a server event it automatically uses the player that fired the event as the first argument.