Im not completely sure if this will work as I am a Beginner Scripter and Im still learning :/
local roundtime = 60 * 5
local intermissiontime = 20
--Variables
local marketservice = game:GetService("MarketplaceService")
local datastore = game:GetService("DataStoreService"):GetDataStore("PointsData")
local serverstorage = game:GetService("ServerStorage")
local replicatedstorage = game:GetService("ReplicatedStorage")
local debris = game:GetService("Debris")
local event = replicatedstorage:WaitForChild("RemoteEvent")
local maps = serverstorage:WaitForChild("Maps")
local mapholder = game.Workspace:WaitForChild("MapHolder")
local statustag = replicatedstorage:WaitForChild("StatusTag")
local timertag = replicatedstorage:WaitForChild("TimerTag")
-- Actual Script
function awardwin(player)
if player then
local mydata = playerdata[player.userId]
local leaderstats = player:FindFirstChild("leaderstats")
if leaderstats and mydata then
mydata.wins = (mydata.wins or 0) + 1
local winsvalue = leaderstats:FindFirstChild("Wins")
if winsvalue then
winsvalue.Value = mydata.wins
points = game:GetService("PointsService")
getPoints = points:GetAwardablePoints()
if getPoints >= 100 then
points:AwardPoints(player.userId, winsvalue.Value)
end
end
end
end
end
Output: 19:30:30.230 - Place has to be opened with Edit button to access DataStores 19:30:30.521 - ServerScriptService.MainScript:147: attempt to index upvalue 'datastore' (a nil value)

1 comment
What exactly is your question?