I'm having trouble making a script that uses a Remote Event work Online. It works fine in studio, but nothing happens elsewhere. I'm using a Remote Event because scripting without this did not work either. I'm just trying to create 3 TextButtons, nothing more. Any and all help is appreciated.
P.S Please don't direct to the "It works fine in Studio but not online" page.
Server Script:
script.Parent.Order.MouseButton1Click:connect(function() Events.OrderParts:FireServer() end)
Remote Event:
script.Parent.OnServerEvent:connect(function() local TextButton1 = Instance.new("TextButton", script.Parent.Parent.Parent) local TextButton2 = Instance.new("TextButton", script.Parent.Parent.Parent) local TextButton3 = Instance.new("TextButton", script.Parent.Parent.Parent) TextButton1.Text = "Order CPU's" TextButton1.TextColor3 = Color3.new(255, 255, 255) TextButton1.Font = Enum.Font.SourceSansItalic TextButton1.BackgroundTransparency = 0.8 TextButton1.Position = UDim2.new(0.8, 0,0.2, 0) TextButton1.Size = UDim2.new(0, 200,0.05, 50) TextButton1.TextScaled = true TextButton1.Name = "OrderCPU" TextButton2.Text = "Order Cases" TextButton2.TextColor3 = Color3.new(255, 255, 255) TextButton2.Font = Enum.Font.SourceSansItalic TextButton2.BackgroundTransparency = 0.8 TextButton2.Position = UDim2.new(0.8, 0,0.35, 0) TextButton2.Size = UDim2.new(0, 200,0.05, 50) TextButton2.TextScaled = true TextButton2.Name = "Ordercase" TextButton3.Text = "Cancel" TextButton3.TextColor3 = Color3.new(255,255,255) TextButton3.Font = Enum.Font.SourceSansItalic TextButton3.BackgroundTransparency = 0.8 TextButton3.Position = UDim2.new(0.53, 0,0.27, 0) TextButton3.Size = UDim2.new(0, 200, 0.05, 50) TextButton3.TextScaled = true TextButton3.Name = "Cancel" end)
You might want to read over the RemoteEvent documentation, since you're confusing a lot of functions. I'll list them here for you:
Use on server scripts only:
Use on local scripts only:
Your script works in studio but not online because Studio doesn't really make a distinction between the client and the server. Make sure you're using all of these events correctly and your script should work fine.