i fire a number.
local hourcount = 01 local minutecount = 00 script.Parent.Hour.MouseButton1Click:Connect(function() hourcount = hourcount + 1 if hourcount <= 10 then hourcount = "0"..hourcount else hourcount = hourcount end if hourcount == 24 then hourcount = 00 end script.Parent.Hour.Text = hourcount end) script.Parent.Minute.MouseButton1Click:Connect(function() minutecount = minutecount + 1 if minutecount <= 10 then minutecount = "0"..minutecount else minutecount = minutecount end if minutecount == 60 then minutecount = 00 end script.Parent.Minute.Text = minutecount end) script.Parent.Submit.MouseButton1Click:Connect(function() game.ReplicatedStorage.SmoothShutdown.TimeSet:FireServer(player,hourcount..":"..minutecount) end)
and then when I pick it up on the server, it prints my username.
game.ReplicatedStorage.SmoothShutdown.TimeSet.OnServerEvent:Connect(function(player,shutdowntime) warn(shutdowntime) game.ReplicatedStorage.SmoothShutdown.TimeSet:FireAllClients(shutdowntime) end)
Hello, xxMVG_Fan8xxALT!
Edit your local script
:
local hourcount = 01 local minutecount = 00 script.Parent.Hour.MouseButton1Click:Connect(function() hourcount = hourcount + 1 if hourcount <= 10 then hourcount = "0"..hourcount else hourcount = hourcount end if hourcount == 24 then hourcount = 00 end script.Parent.Hour.Text = hourcount end) script.Parent.Minute.MouseButton1Click:Connect(function() minutecount = minutecount + 1 if minutecount <= 10 then minutecount = "0"..minutecount else minutecount = minutecount end if minutecount == 60 then minutecount = 00 end script.Parent.Minute.Text = minutecount end) script.Parent.Submit.MouseButton1Click:Connect(function() game.ReplicatedStorage.SmoothShutdown.TimeSet:FireServer(hourcount..":"..minutecount) -- the player parameter is automatically sent end)
Server Script:
game.ReplicatedStorage.SmoothShutdown.TimeSet.OnServerEvent:Connect(function(player,shutdowntime) warn(shutdowntime) game.ReplicatedStorage.SmoothShutdown.TimeSet:FireAllClients(shutdowntime) end)