#scaling problem
30 messages · Page 1 of 1 (latest)
** You are now Level 4! **
it activates when the player spawns in and I'm trying to make it only do that when the player steps on a part
yeah, because you are listening for when a player is added
hence PlayerAdded
also, why do you have two?
Why not you use a Touched event and verify if it's the player that touches it ?
to do it when the player touches a part you need a script inside the part:
script.Parent.Touched:Connect(function(oP)
if op.jjkfdhglskfd --check if its a valid character part
--scale
end)
something along the lines of that
I started scripting 3 days ago so I didn't know about that
Try this :
local Players = game:GetService("Players")
local Part = workspace.Part
Part.Touched:Connect(function(hit)
local character = hit.Parent
player = game.Players:GetPlayerFromCharacter(character)
if player then
character:ScaleTo(0.792) -- Make the character's size 0.792x smaller
end
end)
Ok
Does it work ?
** You are now Level 9! **
Did you insert a part in the workspace ?
I think this should work :
local Part = workspace.Part -- This is a part you have created in the workspace
Part.Touched:Connect(function(hit)
local character = hit.Parent
if character:IsA("Model") then
character:ScaleTo(0.792) -- Make the character's size 0.792x smaller
end
end)
The part is called Head, would that affect it?
Is the part is called Head then :
local Head = workspace.Head -- This is a part you have created in the workspace
Head.Touched:Connect(function(hit)
local character = hit.Parent
if character:IsA("Model") then
character:ScaleTo(0.792) -- Make the character's size 0.792x smaller
end
end)
Did you put you script in a serverscript service ?
No
Where did you put it then ?
Alright, it is a server script right ?
local Head = script.Parent -- This is a part you have created in the workspace
Head.Touched:Connect(function(hit)
local character = hit.Parent
if character:IsA("Model") then
character:ScaleTo(0.792) -- Make the character's size 0.792x smaller
end
end)
I want to make sure I understand what you want. Every time a player touches a part called "Head", it's character's size is 0.792x smaller ?