Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago
Edited 5 years ago

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()
0
Can you show script? Diltz_3 75 — 5y
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) Jexpler 63 — 5y
0
there, i posted an example Edbotikx 99 — 5y
0
You can't access StarterGui from server side User#17685 0 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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()

0
it wont show the whole thing on here, but to see all of it, click "View Source" Zendaya774isstupid 50 — 5y
Ad

Answer this question