So basically I need a script that does stuff with GUI's so I would like it to be in a GUI because when the remote event is fired by a click detector in a part it will do what is said in the GUI script when clicking that part which fires the event. For some reason when I try to fire it from the part it gives the error above in the title. Code below.
The click detector code:
local RepStorage = game:GetService("ReplicatedStorage")
local StartHacking = RepStorage:WaitForChild("StartHacking")
script.Parent.MouseClick:Connect(function()
StartHacking:FireClient()
end)
The client-side script (In GUI):
local repStorage = game:WaitForChild("ReplicatedStorage")
local StartHacking = repStorage:WaitForChild("StartHacking")
-- When StartHacking is called it dose
StartHacking.OnClientEvent:connect(function()
script.Parent:Clone().Parent = game.StarterGui
script.Parent.Parent.Parent.StarterGui.LevelOneHacking.Frame.Visible = true
script.Parent.Parent.Parent.StarterGui.LevelOneHacking.Frame.Starting.Text = "Starting..."
script.Parent.Parent.Parent.StarterGui.LevelOneHacking.Frame.Starting.Visible = true
wait(4)
script.Parent.Parent.Parent.StarterGui.LevelOneHacking.Frame.Starting.Complete.Value = true
script.Parent.Parent.Parent.StarterGui.LevelOneHacking.Frame.Starting.Text = "Done"
wait(2)
script.Parent.Parent.Parent.StarterGui.LevelOneHacking.Frame.Starting.Visible = false
script.Parent.Parent.Parent.StarterGui.LevelOneHacking.Frame.Exploiting.Visible = true
script.Parent.Parent.Parent.StarterGui.LevelOneHacking.Frame.Exploiting.Text = "Exploiting..."
wait(2)
script.Parent.Parent.Parent.StarterGui.LevelOneHacking.Frame.Exploiting.Visible = false
script.Parent.Parent.Parent.StarterGui.LevelOneHacking.Frame.Error.Visible = true
script.Parent.Parent.Parent.StarterGui.LevelOneHacking.Frame.Error.Text = "We got in but the security cameras are still enabled! Press Me to disable them."
end)
