Im trying to make a part where there is a ClickDetector inside of it and when you click it a GUI pops up . Im using a local script since i want that when you click a button and only the player who clicked it can see it . The script is inside ReplicatedFirst and the script Parents the GUI . But when i use this script ,nothing pops up
workspace:FindFirstChild("Part").ClickDetector.MouseClick:Connect(function()
local oGUI = game.ReplicatedStorage.ScreenGui
if oGUI then
local GUI = oGUI:Clone()
GUI.Parent = player.PlayerGui
end
end)
Also when i tried using
local player = game:GetService("Players").LocalPlayer
workspace:FindFirstChild("Part").ClickDetector.MouseClick:Connect(function()
local oGUI = game.ReplicatedStorage.ScreenGui
if oGUI then
local GUI = oGUI:Clone()
GUI.Parent = player.PlayerGui
end
end)
It only says 23:59:06.147 - Part is not a valid member of Workspace can anybody help ?
