Here is my script:
local item1 = game.ReplicatedStorage.remotes.item1
item1.OnServerEvent:Connect(function(amount)
game.Players.LocalPlayer.itemcounter.DC1.Value = game.Players.LocalPlayer.itemcounter.DC1.Value + amount
end)
I had a remote event fired for this to work:
if DC == "DC1" then
b1button2.Text = "$"..DC1price
b3button2.Text = "$"..(DC1price*3)
confirm.Visible = true
b1button1.MouseButton1Click:Connect(function()
if Cash >= DC1price then
Cash = Cash - DC1price
print("item bought")
confirm.Visible = false
item1:FireServer(1) -- this is the event fired
end
end)
The error occurs in the "itemcounter" part, which is a folder that i created through a script in serverscript service, it definately exists, and DC1 is a intvalue also created the sss script.
But itemcounter is aparently a nil value, and its causing an error. Help would be appreciated!!!

2 comments
Here is a weird thing for you, when in a local script when any function like MouseButton1Click is called it automaticly get's the player. But you can call the player in the ()'s still. So what is happening is when you fire the event the script is sending 2 pieces of data instead of one. The Player Who Clicked, and your data. When receiving the data you must require 2 pieces of data.
yeah i got it thanks :)