Jump to content

*removed*


Gravestone

Recommended Posts

First issue I spotted with this script was this;

local player = getPlayerFromNamePart(playername or "") 
if player then 

This if statement doesn't really do anything, it will always be true. Even if a player is not found via that name, you set it to "" instead of false - or nil.

So player will always be either a player element or simply an empty string. It would never return false or nil, thus preventing possible errors when trying to use the player element later on.

You could fix it like this;

local player = getPlayerFromNamePart(playername) 
-- Or 
if(getElementType(player) == "player") then 

Second issue is this;

setPlayerMuted(player, true, true, true, thePlayer, reason, duration) 

As far as I can tell, setPlayerMuted only has 2 arguments, not 7 - unless you made your own command.

Try and see whether setPlayerMuted returns true or false.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...