Why isn't it checking if the player owns the gamepass?

Or he could use like the PlayerAdded event to check when a player is in the game and if they own the gamepass

That would be a more optimized way of checking if the player has the gamepass. @rickrolledlololXD2 could check if the player owns the gamepass once on join, and then set it as an attribute of the player or something similar and check that whenever the player clicks the button.

this was the fix, thanks! i do have another question though, how can i disable the button so it can only be clicked once?

Maybe use something like this.

local clicked = true
if clicked then
      clicked = false
      script.Parent.Enabled = false
end

I’d recommend creating a new topic about this, but here’s the general idea:

-- server sided- exploiters could be able to "click" the button
-- more than once if you disable it on the client
local cooldowns = {}

event.OnServerEvent:Connect(function(plr,...)
	if cooldowns[plr] then return end
	cooldowns[plr] = true
	
	-- if you want it to be able to be activated later,
	-- task.wait(yourCooldownTime) and then set cooldowns[plr] to nil
end)

game.Players.PlayerRemoving:Connect(function(plr)
	-- *This is probably not necessary for you at the moment-
	-- but it will make sure the table doesn't contain
	-- a ton of data for players no longer in the game
	cooldowns[plr] = nil
	-- remove the player's cooldown from the table so that 
	-- the table doesn't store too much 
end)

i just figured it out, its as simple as making interactable false.

That wouldn’t stop exploiters from sending the remote event to the server, but if it works for your use case that’s fine.

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