i have been trying to do this for a while but every tutorial on youtube does not work and i need help i dont know how to do this but this is the last script i entered
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
game.Players.LocalPlayer.ScreenGui.Frame.Visible=true
end
end)
idk what to do for this and its really annoying going from tutorial after tutorial and them not working. if somebody can get me a working script that would be really helpful
ScreenGui s should be placed inside the StarterGui, where they will be relocated in-game to the PlayerGui under the Player
Use :WaitForChild() to make sure a part exists before using / changing it
connect is deprecated in favor of Connect
Server Scripts cannot call the LocalPlayer, and cannot access / read from the PlayerGui, you need to use a LocalScript instead.
local player = game:GetService("Players").LocalPlayer local part = workspace:WaitForChild("ShopPart") part.Touched:Connect(function(hit) if hit.Parent:FindFirstChild(“Humanoid”) then script.Parent:WaitForChild("Frame").Visible = true end end)
In the above example, the part that connects the function is a part under the Workspace named "ShopPart"