Need help on making a dev product turn a part visible when bought

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want to make a part visible to the player that buys the dev product

  2. What is the issue? Not sure how to accomplish this

  3. What solutions have you tried so far? Searched for solutions but didn’t find any

I’m pretty new to scripting, but I have somewhat okay knowledge of things. My only problem is that I can’t figure out how to make the part visible for only the player that bought it.

Roblox’s documentation on the method for handling developer product purchases can be found here, but I will fill in the missing gaps between what the documentation says and what you are looking for.


If you attempt to change something on the server then it will change for everyone, however if you do it on the client, it won’t. Here’s a 2:21 video I found quickly explaining Server and Client, Replication, and Server and Client Scripts.


Use a RemoteEvent to send a request from the server to the client with the RemoteEvent:FireClient(Player, Arguments...) method. This method should be added into your code that runs when the player has bought the specified developer product for turning a part invisible.

The player instance can be found by running the game.Players:GetPlayerByUserId(ProcessReceipt.PlayerId) method. The player’s UserId is contained within the product purchase receipt hence ProcessReceipt.PlayerId. We’ll need this information for filling the first parameter of RemoteEvent:FireClient().

Now that we have a RemoteEvent sending a request from the server to the client, it’s time to create some code on the client. I’ve set up a LocalScript under StarterPlayerScripts.

image

This is the code contained within the LocalScript.

--// Waits for everything in the game to load first
if not game:IsLoaded() then
	game.Loaded:Wait()
end

local RemoteEvent = nil --// Set this as the remote event you have created
local Part = nil --// Set this as the part

RemoteEvent.OnClientEvent:Connect(function()
	Part.Transparency = 1 --// Turns part invisible for the player
end)
1 Like

Yeah this will definitely work!
I also used this to convert client-side into server-side

1 Like

Thank you, it worked! You explained everything very well

1 Like