Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does the server not think that my startergui's exist?

When I tested my game in a server and a script tries to do something to the guis that came from startergui, it comes back saying that that gui doesn't exist. I fixed it via using a playeradded script to add the guis, but I'm wondering why it didn't work before? script e.g

poof = true
function onClick(hit)
if poof == true then
	poof = false
	wait()
script.ImageButton.Name = script.name.Value		
script.Bandages.Parent = hit.PlayerGui.Inventory.Frame.ScrollingFrame
script.Parent.Sound:Play()

wait(0.5)
script.Parent:Destroy()
   end end

script.Parent.ClickDetector.MouseClick:connect(onClick)
wait(30)
script.Parent:Destroy()

4 comments

0

Can you show script?

0

Try adding a player added event, then a character added event. Like this: game.Players.PlayerAdded:Connect(function(plr) (Next line): plr.CharacterAdded:Connect(function(char)

0

there, i posted an example

0

You can't access StarterGui from server side

1 answer

try this!

poof = true
function onClick(hit)
	if poof == true then
  		poof = false
	    	wait()
		script.ImageButton.Name = script.name.Value    
script.Bandages.Parent=game.Players[hit.Name]PlayerGui.Inventory.Frame.ScrollingFrame
		script.Parent.Sound:Play()
		wait(0.5)
		script.Parent:Destroy()

	   end 
	   end
	 
	script.Parent.ClickDetector.MouseClick:connect(onClick)
	wait(30)
	script.Parent:Destroy()

1 comment

0

it wont show the whole thing on here, but to see all of it, click "View Source"

This discussion is preserved as it was. New answers, comments, and votes are closed.