I have problems with Remote Event because i made a Clicker game but when players play then don't see score of each others. and problem is I'don't know where put the RemoteEvent and what edit with this script to work.
--Workspace --Script
game.Players.PlayerAdded:Connect(function(player)
local stats = Instance.new("IntValue",player) stats.Name = "leaderstats"
local Robux = Instance.new("IntValue",stats) Robux.Name = "Robux"
end)
--ScreenGui --LocalScript
local value = script.Parent.Value
local robux = script.Parent.Robux
local upg1 = script.Parent.UPG1
local upg2 = script.Parent.UPG2
local upgx2 = script.Parent.UPGx2
local plr = game.Players.LocalPlayer
local tip = script.Parent.TextLabel
local cc = true
local wt = script.Parent.wait
robux.MouseButton1Down:Connect(function()
if cc == true then
cc = false
robux.Size = UDim2.new(0.11,0,0.23,0)
plr.leaderstats.Robux.Value = plr.leaderstats.Robux.Value + value.Value
tip.Visible = true
tip.Text = ("+"..value.Value)
tip.TextColor3 = Color3.new(math.random(0,255)/255, math.random(0,255)/255, math.random(0,255)/255)
robux.Rotation = math.random(-30,30)
wait(wt.Value)
cc = true
end
end)
robux.MouseButton1Up:Connect(function()
robux.Size = UDim2.new(0.1,0,0.2,0)
tip.Visible = false
wait(0.1)
robux.Rotation = 0
end)
upg1.MouseButton1Click:Connect(function()
if plr.leaderstats.Robux.Value >= 20 then
plr.leaderstats.Robux.Value = plr.leaderstats.Robux.Value - 20
value.Value = value.Value + 1
end
end)
upg2.MouseButton1Click:Connect(function()
if plr.leaderstats.Robux.Value >= 80 then
plr.leaderstats.Robux.Value = plr.leaderstats.Robux.Value - 80
value.Value = value.Value + 5
end
end)
upgx2.MouseButton1Click:Connect(function()
if plr.leaderstats.Robux.Value >= 100 then
plr.leaderstats.Robux.Value = plr.leaderstats.Robux.Value - 100
value.Value = value.Value * 2
end
end)
