Ok do you see where you use TweenService to create tweens, I want you to replace TextPartLabel amd TextPartUIStroke with TextLabel and TextPartUI
The reason is currently the code is trying to tween TextPartLabel amd TextPartUIStroke, which are both strings, and strings dont have a Transparency or TextTransparency property
local TextPartLabel = script.Parent.Parent.Text.SurfaceGui.TextLabel
local TextPartLabelUIStroke = script.Parent.Parent.Text.SurfaceGui.TextLabel.UIStroke
Where is the script parented? Where is the Text part parented? (I assume workspace)
Have you tried waiting for the TextPartLabel to load in? Can I see the full code for the script?
--local varaibles
local Hitbox = script.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Remotes = ReplicatedStorage:WaitForChild("Remotes")
local Text = script.Parent.Parent.Text
local TextPartLabel = Text.SurfaceGui.TextLabel
local TextPartLabelUIStroke = Text.SurfaceGui.TextLabel.UIStroke
---------------------------------------
--Settings
local HitboxRange = 35
---------------------------------------
--Apply Settings
Hitbox.Size = Vector3.new(HitboxRange,HitboxRange,HitboxRange)
---------------------------------------
--hitbox detect
while task.wait(0.1) do
--if player in box
local InsideParts = workspace:GetPartsInPart(Hitbox)
for _, v in pairs(InsideParts) do
if v.Parent:IsA("Model") then
local humanoid = v.Parent:FindFirstChild("Humanoid")
local player = game.Players:GetPlayerFromCharacter(v.Parent)
if humanoid and player then
local PortalHitbox = Remotes:FindFirstChild("PortalHitbox")
PortalHitbox:FireClient(player, TextPartLabel, TextPartLabelUIStroke, true)
end
end
end
--if player not in box
for _, player in pairs(game.Players:GetPlayers()) do
if player.Character then
local character = player.Character
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart and (humanoidRootPart.Position - Hitbox.Position).Magnitude > HitboxRange then
local PortalHitbox = Remotes:FindFirstChild("PortalHitbox")
PortalHitbox:FireClient(player, TextPartLabel, TextPartLabelUIStroke, false)
end
end
end
end
Ok I would recommend trying to use :WaitForChild(‘’) When getting the TextLabel and stroke, example:
local Text = script.Parent.Parent:WaitForChild('Text',30)
local TextPartLabel = Text:WaitForChild('SurfaceGui',30).TextLabel
local TextPartLabelUIStroke = TextPartLabel.UIStroke
Local scripts, and scripts. Scripts are also known as server scripts, or regular scripts.
Scripts are sometimes called Server Scripts as they run on the server, unless you change their RunContext property, which I have no idea how that works so we arent going into that one lol.