#cant get rocks

16 messages · Page 1 of 1 (latest)

civic nexus
#

good day ,
I was trying to make a game in roblox but every youtube channel or site has a different way and i am getting crazy . please help here is the problem.
i am trying to make a game that when u click on a Rock i get rocks to sell them in the store but for some reason i cant get it to give me any rocks here is the script i am using

local part = game.Workspace.giveRock
local click = part.ClickDetector

click.MouseClick:Connect(function()
game.Players.LocalPlayer.leaderstats.Rocks.Value = game.Players.LocalPlayer.leaderstats.Rocks.Value + 2
end)

thank you in advanced coolguy

mint hound
#

I see that is a local script

#

keep in mind that the value will only change for you (not the server)

#

any errors?

civic nexus
#

no errors just that when i walk to the rock and click on it it should give me 2 rocks but it wont give me any

mint hound
#

use a server script then

civic nexus
#

server script sry kinda new to this

mint hound
#

oh ok

#

server script is the white paper one

civic nexus
#

ahh oke

night pawn
#

The one named script

mint hound
#

ye

#
local part = workspace.giveRock
local click = part.ClickDetector

click.MouseClick:Connect(function(plr)
    plr.leaderstats.Rocks.Value += 2
end)
civic nexus
#

thank you for the script and advice it seems to have worked if i have any other questions mind i post again ?

mint hound
#

you should create new posts instead, it's better

civic nexus
#

i will do thank you again ❤️