Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Remote event first click not working? [closed]

Asked by
markjac -11
5 years ago
--local script
par = game.Workspace.RubyGold.Collect

function onClick()
    if script.Parent.Parent.Parent.PlayerProfile.TreasuresCollected.GoldRubyC.Value == 0 then
        game.ReplicatedStorage.GoldRubyRe:FireServer()

game.Workspace.RubyGold.Collect.ClickDetector.Archivable = false
local storage = game:GetService("ReplicatedStorage")
local Treasure = storage["RubyGoldR"]:clone()
Treasure.Parent = game.Workspace
game.Workspace.RubyGoldR:MoveTo(Vector3.new(4.602, 1.546, 164.958))
    end
    end

par:findFirstChild("ClickDetector").MouseClick:connect(onClick)

.

--server script
game.ReplicatedStorage.GoldRubyRe.OnServerEvent:Connect(function(plr)
    local myName = "CollectionValue"

game.ReplicatedStorage.GoldRubyRe.OnServerEvent:Connect(function(plr)

local CollectionValue = plr.PlayerProfile:FindFirstChild(myName)
CollectionValue.Value = CollectionValue.Value + 5

end)
end)

Closed as Too Broad by User#19524

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

Why was this question closed?