now this is the script
01 | local debounce = false |
02 |
03 | function onTouch(hit) |
04 | if hit = = nil then return end |
05 | if hit.Parent = = nil then return end |
06 | if not game.Workspace:FindFirstChild( "Home" ..hit.Parent.Name) then |
07 | if game.Players:findFirstChild(hit.Parent.Name) ~ = nil and debounce = = false then |
08 | debounce = true |
09 | local b = script.Parent.Parent:Clone() |
10 | b.Parent = game.Lighting |
11 | b.Name = "Home" ..hit.Parent.Name |
12 | wait(. 4 ) |
13 | script.Parent.Parent.Ay.Value = hit.Parent.Name |
14 | script.Parent.Head:Remove() |
15 | script.Parent.Parent [ "Home: Nobody" ] .Name = "Home: " ..hit.Parent.Name |
how do I make this a local script so it works on filtering enabled
Renaming:
Renaming a property via localscript will not be recognized by the server. Instead, you can use a RemoteFunction to send the server a request to rename that.
Then, a serverscript will contain the code to rename that certain part, like so.
1 | rS = game:GetService( 'ReplicatedStorage' ) |
2 | Rename = rS.renameFunction |
3 |
4 | Renamer = function (player, Item, Name) --first argument MUST define the player |
5 | Item.Name = tostring (Name) |
6 | end |
7 |
8 | Rename.OnServerInvoke = Renamer |
Now, in a localscript.
1 | rS = game:GetService( 'ReplicatedStorage' ) |
2 | rS.renameFunction:InvokeServer(script.Parent.Parent.Parent, "Home" ..hit.Parent.Name) |
Something like that, at least.
Changing parents also require remotefunctions/events.
Sorry for the vague answer, by the way.
Good luck!