Information about locations of objects used; Local script (Client script) -- Inside PlayerGui. Script (Server script) -- Inside ReplicatedFirst, as a child of another Script. RemoteEvents (Folder) -- Inside Workspace. CustomerEvent (RemoteEvent) -- Inside Workspace, as a child of RemoteEvents (Folder)
LocalScript
local CustomerBusy = false for i,v in pairs(game.Workspace:GetChildren()) do if v:IsA("Model") and v.Name == "HotelConsole" and v:FindFirstChild("CustomerConsole") then print("Console found") v.CustomerConsole.CD.MouseClick:connect(function(plr) print("Console clicked!") local Cash = plr.PlayerGui:WaitForChild("Stats").Cash if CustomerBusy == false and Cash.Value >= 500 and plr.PlayerGui.Stats.AwaitingConfirmation.Value ~= true and plr.PlayerGui.Stats.PlayerHasRoom.Value ~= true then print("Passed test!") CustomerBusy = true v.SellerConsole.Beep:Play() print("Play beep!") game.Workspace.RemoteEvents.CustomerEvent:FireServer(v) print("Sent request to server!") CustomerBusy = false print("End") end end) end end
Local script prints all the way up to "print("End")" Local script IS working. Issue seems to be the Server script..
Server Script
local CustomerBusy = false game.Workspace.RemoteEvents.CustomerEvent.OnServerEvent:connect(function(plr, model) print("Event detected") if CustomerBusy == false then CustomerBusy = true plr.PlayerGui.Stats.AwaitingConfirmation.Value = true model.CustomerConsole.CD.MaxActivationDistance = 0 model.CustomerConsole.CustomerName.Value = plr.Name model.SellerConsole.BrickColor = BrickColor.new("Lime green") model.SellerConsole.CD.MaxActivationDistance = 15 end end)
Does not print "print("Event detected")"
Help?
Very simple, Scripts don't run in ReplicatedFirst. Put them either in the Workspace, or in ServerScriptService.
As a side note, it's probably a little more organized to put your "RemoteEvents folder" inside the ReplicatedStorage service instead of Workspace.