We would rather not write a whole script (Support, not spoon feeding) but you can use the Database that roblox comes with to check if the player has already got the point or not (Data Stores | Roblox Creator Documentation)
The devforum isn’t a place to ask for entire scripts, what you’re looking for is Datastores basically storing data for a specific user even after they leave. Then when they rejoin load their data, which will contain how much parts they have touched. Loop through all the touched parts and set some kind of state to “Touched” which will disable their ability to get that point again. If a non-touched part is touched update their in-game data which will be stored to the datastore once they leave(the touched data can be true/false values for each part/point).
Here is a script for the data-storage, but I am not spoon-feeding you the rest.
local Plrs = game:GetService("Players") -- gets the player service.
local Dts = game:GetService("DataStoreService") -- gets the datastore service.
local points = Dts:GetDataStore("points") -- gets the datastore that stores the points
function LoadPlayerData(player)
local success, err = pcall(function() -- creates a pcall
local ID = player.UserId -- the ID of the user
local PlayerPoints = points:GetAsync(player.UserId) -- User's datastore
if not PlayerPoints then -- checks if the user has data saved
PlayerPoints = 0 -- gives data to the user
end
local leaderstats = Instance.new("Folder") -- makes a leaderboard
leaderstats.Parent = player
leaderstats.Name = "leaderstats"
local IntHolder = Instance.new("IntValue") -- shows the points on the leaderboard
IntHolder.Name = "points"
IntHolder.Parent = leaderstats -- puts it on the leaderboard
IntHolder.Value = PlayerPoints -- puts the value as the saved value
end)
if not success then
warn(err)
end
end
function SavePlayerData(player)
local success, err = pcall(function() -- creates a pcall
local ID = player.UserId
local pointV = player.leaderstats.points.Value -- player's points
points:SetAsync(ID,pointV) -- saves the player's points
end)
if not success then
warn(err)
end
end
Plrs.PlayerAdded:Connect(LoadPlayerData)
Plrs.PlayerRemoving:Connect(SavePlayerData)
Remember to have Studio access to API services on!
Edit: I tested the script and it works perfectly fine. There should be no reason why it doesn’t work. Unless you forgot to enable Studio Access to API services.