I cant code at all lol so I'm trying to modify a free model so that instead of me jumping on top of the book, I need to click it. How would i do that? code:
put = script.Parent.Parent.Book s = script.Parent bounce = false function t(p) if bounce == true then return end bounce = true local h = p.Parent:findFirstChild("Humanoid") if h ~= nil then local gui = put:GetChildren() for i=1, #gui do if gui[i].className == "ScreenGui" then local x = gui[i]:clone() local player = game.Players:GetPlayerFromCharacter(p.Parent) if player ~= nil then x.Parent = player.PlayerGui else print("No player found") end end end end wait(1) bounce = false end s.Touched:Connect(t)
please don't make fun of me for trying to modify a free model k thx.
Add a ClickDetector in a book, and then use this code. In the code, I get the ScreenGuis from the book and clone them into the player clicking. Also make sure it's in a regular script.
local book = script.Parent.Parent.Book local clickDetector = book:WaitForChild('ClickDetector') clickDetector.MouseClick:connect(function(plr) --OnClicked for i,v in pairs (book:GetChildren()) do--For every child of the book if v:IsA('ScreenGui') then--If it's a ScreenGui local clonedGUI = v:Clone()--The clone clonedGUI.Parent = plr.PlayerGui--Put it in PlayerGui. end end end)