#Tycoon button need help

68 messages · Page 1 of 1 (latest)

ripe cairn
#

im new to lua but ive tried to code in plots done that assigned them and when i try copy my button from my example plot to the assigned plot the button from the example plot dissapears im using a model from the toolbox instead of a part.

code:
local TemplateButtons = TemplatePlot.Buttons:clone()

for _, Button in TemplateButtons:GetChildren() do
--get the position of the button
--how far away is the button from the centre
local RelativeCFrame = TemplatePlot.CFrame:ToObjectSpace(Button:GetPivot())
Button:PivotTo(plot:GetPivot(RelativeCFrame))

end

TemplateButtons.Parent = plot

novel halo
#

i'm pretty sure you need to assign the cloned object a parent

#

i think you're just refencing a clone, but not putting it anywhere

novel halo
#

if it is, i imagine you have a few red lines

ripe cairn
ripe cairn
wispy knotBOT
#

studio** You are now Level 1! **studio

novel halo
#

but then you'll probably need to set a position as well in the world

ripe cairn
#

What do you mean?

novel halo
#

when you clone the plot, do you see it in the world?

#

oh mb im reading it wrong

#

you need to parent the buttons

#

you're creating a ref to clone the button but you're not telling it where to clone to

#

broo i cannot read todayy

#

ykw

#

ignore everything i said

ripe cairn
#

main issues is that it aint moving the button and when i play the button isnt even there on the example plot either

#

ill try do some reading and use ai and see if that helps been at college so i posted this and now im gonna try debugg it

ripe cairn
#

ive tried setting the parent before i move it but it didnt fix anything i really dont understand why the buttons dissappearing

novel halo
#

so what do these buttons do?

#

is it like proximity promps

ripe cairn
#

i fixed it from dissapearing on the example plot

#

it just like supposed to be a buy button

#

so when u step on it a conveyer will appear i just havent got around to coding that bit cause of this issue

#

annyway now its just cloned the billboard gui and put it in the centre of my plot

ripe cairn
novel halo
#

gimme a sec

ripe cairn
#

ahhh okok its cloned the button but i need to raise it and still put it near the edge cause rn its in the middle

ripe cairn
#

yess i did it finally

wispy knotBOT
#

studio** You are now Level 2! **studio

novel halo
ripe cairn
#

you did that quick tbh

#

im now getting the error

#

touched is not a valid member of Model "Buttons.Button"

#

and it also got rid of my button on my plot 😭

ripe cairn
#

if Button:IsA("BasePart") then
Button.CanTouch = true
Button.Touched:Connect(function(Hit)
print("Button was touched!")
end)
elseif Button:IsA("Model") then
local buttonPart = Button:FindFirstChildWhichIsA("BasePart")
if buttonPart then
buttonPart.CanTouch = true
buttonPart.Touched:Connect(function(Hit)
print("Button was touched!")

#

ive tried this cause i read it was a fix but still same problem

novel halo
#

roblox is being weird and not letting me access my models 😭 ughh

#

this is different than yours, its auto assigned

#

you could clone the buttons along with the template

#

i made my plot template a model, and anything you put inside will be cloned

novel halo
novel halo
#

there weee gooo

ripe cairn
#

the button has meshes inside of it

novel halo
#

you have to make the touched be on the meshes

ripe cairn
#

ahhhh so put TopOffButton.touched?

novel halo
#

so it would be like

local Button = Buttons.Button.TopOffButton
(assuming thats that part that you would need to touch)

#

yes yes

ripe cairn
#

ahhh ok tyty playing rl rn but i will try it soon

ripe cairn
novel halo
#

yayyy :D

ripe cairn
#

no just need to figure out how to get rid of the button when stepped on because ive coded it rn to destroy the button but it only gets rid of the head but ill watch a video or something for that cause its time to go bed

#

thanks for the help

novel halo
#

ohhh thats ez just add another destroy for the base as well :>

ripe cairn
#

I tried that but then the billboard gui stayed I could've just put it under the Base actually and it would've got destroyed it I think imma use blender to covert the model into a singular mesh so I can get used to that software if I want to make bigger better games

novel halo
#

yeah, i know some blender things if you need help making it into one mesh

ripe cairn
#

its not changing the colour

novel halo
#

wrong mode haha