so im making a blocking system for my game https://www.roblox.com/games/7188556443/Troublesome-Parkour that makes you smaller whenever you press f but once you release it your supposed to go back to your normal size but for some reason it makes you smaller
local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local BlockStop = ReplicatedStorage.RemoteEvents.BlockStop
local BlockStart = ReplicatedStorage.RemoteEvents.BlockStart
local BlockingList = ServerStorage.PlayerList.Blocking
BlockStart.OnServerEvent:Connect(function(player)
wait(0.05)
print("fired")
local String = Instance.new("StringValue")
String.Name = player.Name
String.Parent = BlockingList
for i,v in pairs(player.Character:GetChildren()) do
if v:IsA("Part") then
if v.Name ~= "HumanoidRootPart" then
v.Size = Vector3.new(v.Size.X * 0.95,v.Size.Y * 0.95,v.Size.Z * 0.95)
print(v.Size.X)
end
end
end
end)
BlockStop.OnServerEvent:Connect(function(player)
if BlockingList:FindFirstChild(player.Name) then
BlockingList[player.Name]:Destroy()
end
for i,v in pairs(player.Character:GetChildren()) do
if v:IsA("Part") then
if v.Name ~= "HumanoidRootPart" then
v.Size = Vector3.new(v.Size.X / 0.95,v.Size.Y / 0.95,v.Size.Z / 0.95)
print(v.Size.X)
end
end
end
end)
it should work like this
but its this lol
https://gyazo.com/f92025b39d8dd4acf0d3535935de3ee5