Hi. This is my first time trying to pass an argument through a remote event. The remote is firing correctly but for some reason, my second argument ‘thing’ isn’t passing through. Any help is appreciated!
LocalScript
script.Parent.MouseButton1Click:Connect(function()
local player = game.Players.LocalPlayer
local thing = "TreeHouse"
game.ReplicatedStorage.Events.Buy:FireServer(player,thing)
end)
ServerScript
game.ReplicatedStorage.Events.Buy.OnServerEvent:Connect(function(player,thing)
if thing == "TreeHouse" then
local price = 10
game.ReplicatedStorage.PlayerData[player.DisplayName].Money.Value -= price
elseif thing == "LogHouse" then
local price = 40
game.ReplicatedStorage.PlayerData[player.DisplayName].Money.Value -= price
elseif thing == "GardenHouse" then
local price = 50
game.ReplicatedStorage.PlayerData[player.DisplayName].Money.Value -= price
end
end)