hey guys, i have this “state” variable i made to be sent to the script. im just having trouble with the state tbh. i appreciate any help.
local script:
yes.MouseButton1Click:Connect(function()
local state = "yes"
plrcheckEvent:FireServer(myPlr, state)
end)
no.MouseButton1Click:Connect(function()
local state = "no"
plrcheckEvent:FireServer(myPlr, state)
end)
script:
plrcheckEvent.OnServerEvent:Connect(function(myplr, state)
plrchoiceUI.Enabled = false
--if clicked no
if state == "no" then
if selectedButton then
selectedButton.BackgroundColor3 = unselectedColor
end
end
--if clicked yes
if state == "yes" then
if selectedButton then
selectedButton.BackgroundColor3 = unselectedColor
end
if selectedButton then
local findPlr = plrs:FindFirstChild(selectedButton.Text)
if findPlr and findPlr ~= myplr then
if findPlr.Character.Humanoid.Health > 0 then
findPlr.Character.Humanoid.Health = 0
end
end
end
end
end)