local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("UpgradeEvent")
local Pcframe = game.Players.LocalPlayer.PlayerGUI.Gui.Shopframe
local function Buy()
if game.Players.LocalPlayer.leaderstats.Pc.Value == 0 then
game.Players.LocalPlayer.leaderstats.Cash.Value = game.Players.LocalPlayer.leaderstats.Cash.Value - 1000
game.Players.LocalPlayer.leaderstats.Pc.Value = game.Players.LocalPlayer.leaderstats.Cash.Value + 1
Pcframe.buy.Text = "Pc Maxed Out"
Pcframe.buy.BackgroundColor3 = Color3.fromRGB(186, 0, 0)
Pcframe.buy.Frame.BackgroundColor3 = Color3.fromRGB(147, 0, 0)
end
end
remoteEvent.OnServerEvent:Connect(Buy)
This is my remote event script I need it else my datastore won't update but how to let the remote event use a local script cause the remote event needs to be in a normal script?
