You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to destroy the wall the player is trying to remove after player clicks “Yes” Button
What is the issue? Include screenshots / videos if possible!
I am not sure how to make script understand which wall player tries to remove
I can make something like yesButton.Activated > Wall1.Destroy()
but I don’t want to do it that way because there are many walls and other stuff.
so
How Can I make script understand which wall player tries to buy
you can detect the walls name, use attributs, use objectvalues, use stringvalues, use variables, use arguments, a lot of stuff really (if i understand your post, then this is prolly what ur looking for)
Can you quickly give example?
if you are trying to say something like
Use a value and then remove walls depends on it like
if Value = 1 then remove Wall1
if Value = 2 then remove Wall2
etc
then if there is like 10 walls Then it will take so much line
YEAH and question is how to Look for Wall named Wall1 when player Clicks to yes button
and not Other walls
OR how to look for Wall 2 next time player clicks to yes button
--local script
local remote = game.ReplicatedStorage.RemoteEvent
local yesbutton = script.Parent -- path to the Yes button
yesbutton.Activated:Connect(function()
remote:FireServer()
end)
--serverscript
local remote = game.ReplicatedStorage.RemoteEvent
local module = require(idk where your module script is)
remote.OnServerEvent:Connect(function(player, wall)
for i, v in pairs(module) do
if table.find(i, wall) then
player.leaderstats.Cash.Value -= v.Price
end
end
end)
this code is VERY rushed and not the best, but i think you can improve it to fit your liking
so. I am asking again How server will know WHICH Wall I am trying to remove. THE code just sends The wall Named “Wall” What if I want to remove Wall2 After Wall1
this is just for removing ONE wall. doesn’t depends on the one I Choose