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

How do I Make a gui clone into a players gui when they touch a part??

So i did this

script.Parent.Touched:Connect(function(hit)
	local player = hit.Parent:GetPlayerFromCharacter()
	local gui = game.ServerStorage.ScoreBoard:Clone()
	gui.Parent = player.PlayerGui
end)

and says "GetPlayerFromCharacter is not a valid member of Model" and also i dont want it to clone multiple times

1 answer

✓ Accepted answer

You dont invoke the method on the model, you invoke the method on game.players, hit.Parent will be the argument to pass inside the method

local player = game.Players:GetPlayerFromCharacter(hit.Parent)

If you do not want it to be cloned multiple times, search up something called debouncing

3 comments

0

Doesn't work but I figured it out. Thanks for trying :/

0

Edited it, wrote the argument inside the parameter wrong just now

0

If the code above works please accept the answer so others will be able to learn from it thanks

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