Hi! This is supposed to work for whatever player touched this part, and it’s supposed to go invisible for them, but not other people that want to collect it. However, it isn’t going invisible for the ones that collected it? I need some help if I can get it.
What do you want to achieve? What the title says. How to make a Touched Function in a LocalScript work.
What is the issue? The code for it is not working. At all.
What solutions have you tried so far? Tried changing it, still nothing.
Okay, so here is my current code I have.
local Leaf = script.Parent
local Players = game.Players or game:GetService("Players")
debounce = false
if hit.Parent ~= nil and Players:FindFirstChild(hit.Parent.Name) and debounce == false then
debounce = true
Leaf.Transparency = 1
How do I tweak this code for it to work?
I assume that the part is in the workspace.
Basically you can’t use local scripts in the workspace.
You can put the local script somewhere else and define the leaf’s location.
EDIT: In the roblox documentation there’s a list of places where a local script can be used at:
You can read more here: LocalScript | Roblox Creator Documentation
Okay, thanks. I’ll try it and see if it works.
Thanks. That worked. It works like a charm.
This isn’t true (not anymore at least)
You can have a
LocalScript run in the
Spawn a Regular Script
Change the Scripts
Client (located on the Behavior tab), this will turn the Script into a LocalScript
After that it will run on the
Note: this only works with Regular Scripts
Documentation: (It leads to Disabled for some reason)
Oh cool, I’ll check that out as well.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.