Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Remote Event works in studio but not in game?

Asked by 5 years ago

--Server script placed in ServerScriptService

local repStorage = game:GetService("ReplicatedStorage")
local remote = repStorage:WaitForChild("Remote")

remote.OnServerEvent:Connect(function(player)
    print("SERVER")
    local MoonArcTemplate = Instance.new("Part")
    MoonArcTemplate.Name = "MoonArc";
    MoonArcTemplate.Anchored = true;
    MoonArcTemplate.CanCollide = false;
    MoonArcTemplate.Transparency = 1;
    MoonArcTemplate.Size = Vector3.new(1,1,1);  

    local moonDecal = Instance.new("Decal",MoonArcTemplate)
    moonDecal.Texture = "http://www.roblox.com/asset/?id=12345678"

    MoonArcTemplate.Position = player.Character["UpperTorso"].Position
end)

--Local script inside a text button

local repStorage = game:GetService("ReplicatedStorage")
local remote = repStorage:WaitForChild("Remote")

script.Parent.MouseButton1Click:Connect(function()
    remote:FireServer()
end)

This works on Roblox studio but when I run it online, the remote event does not even fire( Print("SERVER") doesn't even run)

0
You could try waiting for the text button first. jackfrost178 242 — 5y
0
Did you check the Server Console, not the Client Console? and you never set the parent of MoonArcTemplate. yyyyyy09 246 — 5y
0
I checked the server console, and I tried waiting for the text button but still got no response. For some odd reason, changing the variable "remote" to "rem" fixed things :\ secretboy6 68 — 5y
0
I know this throws me off too but I'm sure that you're not supposed to capitalize the "connect" in those functions. I think roblox breaks online if you capitalize them. lazycoolboy500 597 — 5y

Answer this question