-- Server
remote4.OnServerEvent:Connect(function(plr,hit,selected)
if selected == "Bullet" then
for i = 1, 500 do
print("pew")
task.wait(0.25)
end
elseif selected == "Missile" then
for i = 1, 20 do
print("boom")
task.wait(0.5)
end
elseif selected == "Nuke" then
print("Nuke")
end
-- Client
local selected = nil
local function selection(button)
if selected ~= nil then
selected.Text = string.gsub(selected.Text, " <", "")
end
button.Text = (button.Text .. " <")
selected = button
end
The client just sets selected
to whatever the name of the button I click and sends it to the server script
though what happens is that the server completely ignores the whole block of code above. help would be appreciated