I understand that my question is very broad but I did not know how else to put it. To give you some context, I watching a tutorial about DataStorage and how to make it work with a shop GUI. The video I was watching on YT (https://www.youtube.com/watch?v=I-juZw7pmuQ&t). In short, I created a saving currency DataStorage and a shop GUI. When a player has enough points for an item in the shop, it will clone the item into the player's backpack and into the starter gear. This was successful in Roblox Studio but not in the Roblox Server.
Local Script:
for i,v in pairs(script.Parent:GetChildren()) do
if v:IsA("TextButton") then
v.MouseButton1Click:Connect(function()
game:GetService("ReplicatedStorage").Events.RemoteEvent:FireServer(v.Name, v.ItemPrice)
end)
end
end
Script:
game:GetService("ReplicatedStorage").Events.RemoteEvent.OnServerEvent:Connect(function(player, item, price)
print(price)
if player.Money.Value >= price.Value then
local itemClone = game:GetService("ServerStorage")[item]:Clone()
itemClone.Parent = player.Backpack
local itemClone2 = game:GetService("ServerStorage")[item]:Clone()
itemClone2.Parent = player.StarterGear
end
end)
It returns an error saying "attempt to index local 'price' (a nil value)". Please look at the video I provided to try it out for yourself.

2 comments
Since this is not your script, we can't help you.
@incapaz How come? It's off a YouTube tutorial. I understand it. I know how it works. I just can't seem to figure out why it only works on studio and not on a regular server.