I am making a gui where when you say ‘!training’ a gui appears and you have 2 options, attend and ignore.
Everything on the gui works perfectly. The problem is that it is not replicating to every player in the server even when I am using remote events.
– Server Script –
local frame = script.Parent.Parent
local mainFrame = frame:WaitForChild("MainFrame")
local attend = mainFrame:WaitForChild("Attend")
local ignore = mainFrame:WaitForChild("Ignore")
local promptTraining = mainFrame:WaitForChild("PromptTraining")
local clickedAttend = false
promptTraining.OnServerEvent:Connect(function(player)
frame:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quint", 0.5)
attend.MouseButton1Click:Connect(function()
if clickedAttend == false then
clickedAttend = true
local character = player.Character or player.CharacterAdded:Wait()
local humanoidRootPart = character.HumanoidRootPart
humanoidRootPart.CFrame = workspace.AttendClicked.CFrame
frame:TweenPosition(UDim2.new(1, 0, 0, 0), "In", "Quint", 0.5)
wait(0.5)
clickedAttend = false
end
end)
ignore.MouseButton1Click:Connect(function()
frame:TweenPosition(UDim2.new(1, 0, 0, 0), "In", "Quint", 0.5)
end)
end)
– Local Script –
local frame = script.Parent.Parent
local mainFrame = frame:WaitForChild("MainFrame")
local attend = mainFrame:WaitForChild("Attend")
local ignore = mainFrame:WaitForChild("Ignore")
local promptTraining = mainFrame:WaitForChild("PromptTraining")
local alreadyHosting = mainFrame:WaitForChild("AlreadyHosting").Value
local player = game.Players.LocalPlayer
local prefix = "!"
player.Chatted:Connect(function(chatMessage)
if alreadyHosting == false then
alreadyHosting = true
if chatMessage == prefix .. "training" then
promptTraining:FireServer(player, alreadyHosting)
end
alreadyHosting = false
end
end)
I REALLY need help with this as it will give me more experiance in remotevents.