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

My RemoteEvent only prints what I want in Solo mode, How do I fix this?

Asked by 8 years ago
Edited 8 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.

Here is the local script

01local Gui = script.Parent
02local player = game.Players.LocalPlayer
03Gui.BackgroundColor3 = Color3.new (0, 151/255, 111/255)
04function sw()
05 
06    if Gui.BackgroundColor3 == Color3.new (0, 151/255, 111/255) then
07        Gui.BackgroundColor3 = Color3.new(208/255, 174/255, 0)
08        print ("Works")
09        wait(3)
10        Gui.BackgroundColor3= Color3.new(1, 6/255, 26/255)
11        local k = game.ReplicatedStorage.IDCard:Clone()
12        k.Parent =  player.Backpack
13    game.Workspace.MyServerEvent:FireServer()
14    else
15    wait (2)
View all 27 lines...

Here is the other script

1local event = Instance.new("RemoteEvent")
2event.Parent = game.Workspace
3event.Name = "MyServerEvent"
4event.OnServerEvent:connect(function()
5    game.StarterGui.ScreenGui.Frame.TextButtonss.BackgroundColor3 = Color3.new(1, 6/255, 26/255)
6    print ("Color has been changed in the server")
7end)

What I'm trying to do ,is, when a player clicks on the textbutton they receive a key and the textbutton gui turns red for the WHOLE SERVER, so everyone knows that the room is booked out.

1 answer

Log in to vote
0
Answered by 8 years ago

try adding a wait(2) at line 1

Ad

Answer this question