Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

filtering enabled making breaking my script?

Asked by 7 years ago
Edited 7 years ago

now this is the script

01local debounce = false
02 
03function onTouch(hit)
04if hit == nil then return end
05if hit.Parent == nil then return end
06if not game.Workspace:FindFirstChild("Home"..hit.Parent.Name) then
07if game.Players:findFirstChild(hit.Parent.Name) ~= nil and debounce == false then
08debounce = true
09local b = script.Parent.Parent:Clone()
10b.Parent = game.Lighting
11b.Name = "Home"..hit.Parent.Name
12wait(.4)
13script.Parent.Parent.Ay.Value = hit.Parent.Name
14script.Parent.Head:Remove()
15script.Parent.Parent["Home: Nobody"].Name = "Home: "..hit.Parent.Name
View all 24 lines...

how do I make this a local script so it works on filtering enabled

1 answer

Log in to vote
0
Answered by
Fifkee 2017 Community Moderator Moderation Voter
7 years ago

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.

1rS = game:GetService('ReplicatedStorage')
2Rename = rS.renameFunction
3 
4Renamer = function(player, Item, Name) --first argument MUST define the player
5    Item.Name = tostring(Name)
6end
7 
8Rename.OnServerInvoke = Renamer

Now, in a localscript.

1rS = game:GetService('ReplicatedStorage')
2rS.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!

0
Also, I assumed you already made a remotefunction. I like doing that. Fifkee 2017 — 7y
Ad

Answer this question