Serverscript GetRankInGroup

  1. What do you want to achieve? To play tween animation.

  2. What is the issue? Doesnt play the tween.
    Error on

if Player:GetRankInGroup(GROUPID) >= 0 then
  1. What solutions have you tried so far? Yes but no solutions.
CLOSE.MouseButton1Click:Connect(function(Player)
	if Player:GetRankInGroup(GROUPID) >= 0 then
		CloseTween:Play()
end
end)
1 Like

Please help me at this. Thanks you.

is the CLOSE variable a TextButton or ImageButton? if it is, then you can’t use it for Player

Read the documentation links below if you want to know some information about it :wink:

https://create.roblox.com/docs/reference/engine/classes/GuiButton#MouseButton1Click

https://create.roblox.com/docs/reference/engine/classes/Player#GetRankInGroup

1 Like

Its a SurfaceGUI and yes UI Button.

Player isn’t a vaild member of the class MouseButton1Click you could use Players.LocalPlayer

But I have to use serverscript to make everyone see moving the part.

1 Like

You can use a remoteEvent to fire across server-client side

But I don’t want to do it. Because I am lazy and exploiters can fire it too. This part exploiters can fire too, so I don’t like to use remoteevent.

1 Like

It’s returning a number of the group rank.

it’s difficult to get the player clicking it on a SurfaceGui though, the error from @Sallypulman says Player isn’t a valid member of the class MouseButton1Click you could use Players.LocalPlayer best fits for the client but for server-scripts, it’s not possible to use it though, and RemoteEvents will always be fired by exploiters regardless of how much security you put in as they can figure out how it works and grab every information about it, and RemoteFunctions is for returning content of an item when <RemoteFunctionInstance>:InvokeClient() or <RemoteFunctionInstance>:InvokeServer() after adding some function to it.

1 Like

Also, just a question. At other script. Below one is MouseClick.


This works. Below one is SurfaceUI and MouseButton1Click.

This doesn’t work. Please explain me why surfaceUI cant.

probably roblox didn’t add that to luau C++ for now,

SurfaceUI currently can’t get the player who pressed a button, as well as it’s not a LocalScript, and there are alternatives by using ClickDetectors or ProximityPrompts as they have an player thing you can insert when interacted event.

1 Like

What if the system is duplicated. It will work?

I am currently making the station home door system. and if the door model is duplicated it works?
Like this.
https://gyazo.com/f8d7428dc9027238442aa0d73117ee21

1 Like

I am confusing on this part.
image
Should I make like game.workspace…? Or Other because I want to duplicate the model? (ServerscriptService RemoteEvent)

Can someone help me with this? Please?

define the part you want, then replace script.Parent with the part you chose

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.