It's meant to insert a random skin into the inventory but it's only giving holiday crowns
Num = 0 function script.RemoteFunction:OnServerInvoke(id) math.randomseed(tick()) Num = math.random(1,100) local Skin = "nil" if Num > 50 then Skin = "blue" else if Num > 10 then Skin = "Pirate" else Skin = "Holiday Crown" end end local Inv = game:GetService("DataStoreService"):GetDataStore("Inventory"):GetAsync(id) table.insert(Inv,Skin) game:GetService("DataStoreService"):GetDataStore("Inventory"):SetAsync(id,Inv) return Skin end
you add a remote event
This happened to me once when I was experimenting with math.randomseed. I did this in command bar
math.randomseed(tick()) print(math.random(1,10)) --prints 3 all the time
You are only supposed to do math.randomseed before you do randoming. For example,
math.randomseed(tick()) function something(times) local times = times or 1 if times > 20 then return end print(math.random(1, 10)) something(times + 1) end something()
Hope this helps!