I’m not sure why, but I cant get anything from .Changed in a server sided script, The property in the Bool Value is being changed to true, but the script isnt detecting that. I have a print setup right after the bool.changed function but nothing prints. Below Is the script that sets the bool to be true, and the script that detects the change.
Setting the Bool (Server)
local rs = game:GetService("ReplicatedStorage")
local plants = rs:WaitForChild("Plants")
local event = rs.Plants.PlantEvent
local seeds = plants:WaitForChild("Seeds")
script.Parent.Triggered:Connect(function(plr)
if script.Parent.Parent.Planted.Value == false and script.Parent.Parent.Tilled.Value == true then
plr.PlayerGui.Menus.PlantSeed.Visible = true
end
end)
event.OnServerEvent:Connect(function(plr, plant)
if plr.stats[plant].Value >= 1 then
local clone = seeds:FindFirstChild(plant):Clone()
clone.Parent = script.Parent.Parent
script.Parent.Parent.Planted.Value = true
plr.stats[plant].Value -= 1
clone:FindFirstChild("Growing").Value = true
script.Parent.Enabled = false
plr.PlayerGui.Menus.PlantSeed.Visible = false
end
end)
Script for detecting the change (Server)
local tweenService = game:GetService("TweenService")
script.Parent.Growing.Changed:Connect(function()
print("test1")
if script.Parent.Growing.Value == true then
print("test2")
for i, v in pairs(script.Parent:IsA("Part")) do
print("test3"..v)
local tweenInfo = TweenInfo.new(5, Enum.EasingStyle.Linear)
local goal = {Size = Vector3.new(0.125, 4, 0.125)}
local tween = tweenService:Create(v, tweenInfo, goal)
tween:Play()
end
end
end)
Any help is appriciated, I’ve only ever used .Changed in LocalScripts.
Hierarchy