Hello I ran into this problem, so I whenever you touch the certain part you get a point. I have it in a module script the amount that you get per touch so I can change it anytime i want without going into every script. I want the amount of points to be random from 3-5 but it only choose one number. I want it to randomly choose but not the same number, any help is appreciated.
Module Script:
local GameStats = {
["Winter"] = math.random(2,5);
}
return GameStats
Script
local V_ = game:GetService("ServerScriptService")
local PopIt = script.Parent
local db = false
local B_ = game.ServerScriptService.Statistics
local M_ = require(B_.GameStats)
local PointsForPop = M_.Winter
local Cooldown = M_.CooldownForSmall
--//Services
local Players = game:GetService("Players")
--//Variables
local Part = script.Parent
--//Controls
local debounce = false
local cooldownTime = 1
--//Functions
Part.Touched:Connect(function(hit)
local Player = Players:GetPlayerFromCharacter(hit.Parent)
if Player and not debounce then
debounce = true
Part.Transparency = 1
Part.CanCollide = false
Player.leaderstats.Pops.Value += PointsForPop
task.wait(cooldownTime)
debounce = false
Part.Transparency = 0
Part.CanCollide = true
end
end)