#MAKING SOMETHING DISAPPEAR BUT ONLY FOR THE PLAYER THAT CLICKED ON IT

37 messages · Page 1 of 1 (latest)

latent jacinth
#

I’m trying to make a script where if the local player clicks on the model the script is attached to it removes its collision, turns it completely transparent and turns non-clickable but only for the player that clicked on it but idk how to

uncut steppe
latent jacinth
#

It just won’t do it

uncut steppe
latent jacinth
#

Like idk why it not working

#

local clickdetector = script. Parent
local model = script.parent.parent.parent
part. clickdetector-mouseclick: connect (function()
model. part. Transparency = 1
model. part. CanCollide = false
model. partl. Transparency = 1
model. partl. CanCollide = false
model. part2. Transparency = 0
model. part2. CanCollide = true
model.part3. Transparency = 0
model. part3. CanCollide = true
end)

#

That’s the script

#

Idk what’s wrong with it

uncut steppe
#

it shows it as soon as you copy the code into a text editor

#

You also have some other issues with space and some -, which should be a . But the main problem stems from the part not being declared

latent jacinth
willow obsidianBOT
#

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

uncut steppe
#

Well you're telling the script to look at "part" but you never told it what part is

#

So then it's nil. And nil.Clickdetector doesn't exist

#

the code giving you a read line under the text (or green in this case due to the -) is it telling you that you missed something

latent jacinth
#

How do I tell it what part

uncut steppe
#

by declaring it

latent jacinth
#

How do I do that

uncut steppe
#

Hm, I would recommend first learning basic scripting terms

#

Updated for 2023, this is my Roblox scripting tutorial. In this episode, you'll be taught the essentials for getting started. Learn how to script on Roblox with just 30 minutes of content, by watching the entire series!

With the recommended plugin linked below, learn how to code in Lua much quicker by practising your skills alongside the tutori...

▶ Play video
ripe gyro
#

And fix your syntax

#

Oh wait you can just do clickdetector.MouseClicked

#

U don't need part

uncut steppe
ripe gyro
#

Ye

uncut steppe
#

You can prechew it. But at this point you're just building a house in a swamp

latent jacinth
#

I still don’t get it

ashen coral
#

If that’s what you want

median harbor
#

solving your script is no hard problem but that doesn't mean you'll come out of it benefiting anything if you still don't understand how to script in the first place

median harbor
tender jackal
#

i mean i have a script backed up but when you click it everyone sees it :/

unique yarrow
#

Client so it's only the Player
Who clicked it
[EVENT]
Set proprety and ur done
[END]