Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local RS = game:GetService("ReplicatedStorage")
- local ev = RS.RemoteEvent
- local textBox = script.Parent
- local text = textBox.Text
- local shape = ""
- local shapes = {"Ball", "Wedge", "Cylinder", "Block"}
- print(shapes[1])
- local function checkForText()
- if textBox.Text == shapes[1] then
- shape = shapes[1]
- end
- if textBox.Text == shapes[2] then
- shape = shapes[2]
- end
- if textBox.Text == shapes[3] then
- shape = shapes[3]
- end
- if textBox.Text == shapes[4] then
- shape = shapes[4]
- end
- end
- textBox.Changed:Connect(checkForText)
- textBox.Changed:Connect(function(_)
- checkForText()
- if shape == shapes[1] or shape == shapes[2] or shape == shapes[3] or shape == shapes[4] then
- ev:FireServer(shape)
- else
- print("Invalid shape!")
- return
- end
- end)
Add Comment
Please, Sign In to add comment