Basically, I am making something where you put a number in a text box, click submit, then it changes a player’s numbervalue to the number in the textbox but it isn’t working.
Server Code:
game.ReplicatedStorage.arrestEvent.OnServerEvent:Connect(function(plr, reason, arrestTime, target)
local detainee = game.Players:FindFirstChild(target)
detainee.jailTime.Value = arrestTime
end)
Client Code:
script.Parent.MouseButton1Click:Connect(function()
if script.Parent.Text == "SAVE" then
script.Parent.Parent.reasonText.Text = "REASON: "..script.Parent.Parent.arrestReason.Text
script.Parent.Parent.arrestTime.Text = "ARREST TIME: "..script.Parent.Parent.arrestTimeText.Text
script.Parent.Text = "CONFIRM"
else
if script.Parent.Text == "CONFIRM" then
game.ReplicatedStorage.arrestEvent:FireServer(script.Parent.Parent.arrestReason.Text, script.Parent.Parent.arrestTime.Text, script.Parent.targetName.Value)
end
end
end)