Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why this thing i made only Visible for myself?

Asked by 5 years ago

So i made this script and it totally worked but the thing is, When i play with others i only saw myself become big but the others are just normal and floating to the air?

this is the Local Script

local input = game:GetService("UserInputService")
local player = game.Players.LocalPlayer



local animations = {2469483212}



local ready = true









local function Hulk(inputObject)
    if inputObject.KeyCode == Enum.KeyCode.LeftAlt and ready then
        local char = player.Character or player.CharacterAdded:Wait()
        local hum = char.Humanoid
        local animation = Instance.new("Animation")
        local picked = 1
        local punch = script.Parent.Punch_Local
        animation.AnimationId = "http://roblox.com/asset/?id="..animations[picked]
        local AnimaTrack = hum:LoadAnimation(animation)
        AnimaTrack:Play()
        hum.WalkSpeed = 0
        wait(.01)
            print(player)
        hum.BodyDepthScale.Value=hum.BodyDepthScale.Value+5
        hum.BodyWidthScale.Value=hum.BodyDepthScale.Value+5
        hum.BodyHeightScale.Value=hum.BodyHeightScale.Value+5
        hum.HeadScale.Value= hum.HeadScale.Value+5

        punch.Disabled = false
        wait(1)
        hum.WalkSpeed = 40
        ready = false

                end
            end


input.InputBegan:connect(Hulk)

THANK YOU IN ADVANCE!

0
You need to modify the size on a server script. RayCurse 1518 — 5y
0
Server Script is the "Script " Right? But how am i going to do that? Do the same thing as what i did on a local script? Pdpieee 1 — 5y
0
Use a remote event that fires to the server inside that function. The server will then listen for it and increase the scale. You should just have to use lines 33 to 36. WalkSpeed should also be changed on the server. xPolarium 1388 — 5y

1 answer

Log in to vote
0
Answered by
cc567 50
5 years ago
Edited 5 years ago

This is because you're taking into consideration FilteringEnabled. What this does is limits local scripts on each players clients to only modify the client themselves (which is why only you see yourself large). What you must do is call a remote event. The remote event has an event called (OnServerEvent). Connect the size change to the OnServerEvent like so

Note: The script connecting the RemoteEvent is a regular script (NOT LOCAL)

RemoteEvent = game.ReplicatedStorage.RemoteEvent

RemotrEvent.OnServerEvent:Connect(function()
    --Make your avatar thicc
end)

Now in the local script you don't change the size directly, but you activate the event (which will change the size as seen above)

RemoteEvent = game.ReplicatedStorage.RemoteEvent

RemoteEvent:FireServer() --[[This will make the avatar larger since the size change is now connected to the RemoteEvent everytime it fires]]--

Let me know if you have any questions

0
THANK YOU VERY MUCH. but i have another question, i can't disable the punch script now when i am not large yet. Thanks again :> Pdpieee 1 — 5y
Ad

Answer this question