-
What do you want to achieve?
I want to detect if the script’s parent has changed. -
What is the issue?
The event (Instance.AncestryChanged) I’m using simply wont work. -
What solutions have you tried so far?
I’ve browsed the devForums a little bit but none the solutions worked.
I have also tried using Instance:GetPropertyChangedSignal(“Parent”) which doesn’t work.
Script that changes the parent (located in ServerScriptService)
local curses = game:GetService("ServerStorage"):WaitForChild("Prefabs"):WaitForChild("CurseScripts")
local curse = curses.Giant:Clone()
game:GetService("Players").PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
curse.Parent = plr.Curses
end)
end)
The script that is suppose to detect if the parent has changed (Stored in ServerStorage)
script.AncestryChanged:Connect(function()
print("wdadjawdwadjw")
local plr = script.Parent.Parent
local char = plr.Character or plr.CharacterAdded:Wait()
local mod = require(game:GetService("ServerStorage"):WaitForChild("Mods").CharacterResizer)
mod.ResizeCharacter(char, 10)
end)
The script gets put into the right folder but it just doesnt trigger the event.
It doesnt print as well.