Hi, I'm AswormeDorijan111 i need help. I'm good graphics developer but I don't know scripting a lot... So can you please help me how to StarterGui GUI Show when I touch a part. Please please help. :)
script.Parent.Touched:connect(function(hit) game.StarterGui.Buy1.Enabled = true wait(300) game.StarterGui.Buy1.Enabled = false end)
Hello, your problem is that you're not detecting when a certain player is stepping over a part and you're accessing the StarterGui instead of the player's PlayerGui.
Here's the correct code. Put this in a script inside of your part.
local Players = game:GetService("Players") local debounce = false --Prevent a ton of hit detections at once. local function onTouched(hit) if hit.Parent:FindFirstChild("Humanoid") then --Checks if a humanoid hit. if not debounce then debounce = true local chr = hit.Parent local plr = Players:GetPlayerFromCharacter(chr) if plr then --Checks if it was a player. if plr.PlayerGui:FindFirstChild("Buy1") then --Makes sure the player has the right gui. if plr.PlayerGui.Buy1.Enabled == false then plr.PlayerGui.Buy1.Enabled = true wait(3) plr.PlayerGui.Buy1.Enabled = false end end end end debounce = false end end script.Parent.Touched:connect(onTouched)
Hope this is what you wanted if it isn't tell me.