HowToRoblox

ConfirmNameChangeScript

Mar 25th, 2020
2,689
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.36 KB | None | 0 0
  1. local confirm = script.Parent.ConfirmButton
  2.  
  3. local input = script.Parent.NameInput
  4.  
  5.  
  6. local remoteEvent = game.ReplicatedStorage.NameChangeEvent
  7.  
  8.  
  9.  
  10. confirm.MouseButton1Click:Connect(function()
  11.    
  12.    
  13.     local name = input.Text
  14.    
  15.    
  16.     input.Text = ""
  17.    
  18.    
  19.     if string.len(name) < 1 or string.len(name) > 50 then return end
  20.    
  21.    
  22.     remoteEvent:FireServer(name)
  23. end)
Add Comment
Please, Sign In to add comment