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

How do i locate a player inside the workspace (i need to place something inside player's torso)?

Asked by
Echtic 128
6 years ago

So as i said in the title i need to place a new Instance inside of player's torso.This is how i've tried to do it but i can't locate the player inside the workspace

local ff = Instance.new("ForceField")
ff.Parent = game.Workspace.
ff.Visible = false
0
What player you need to find? royee354 129 — 6y
0
An owner of it's parent script Echtic 128 — 6y
0
You want this to happen like a regular force field each time the player respawns? royee354 129 — 6y
0
There is a certain fruit which when eaten should give that force field to a player Echtic 128 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Firstly, the following code should be a local script inside of StarterCharacterScripts

local player = game.Players.LocalPlayer
local character = player.Character
local ff = Instance.new("ForceField")
ff.Parent = character.Torso -- change Torso to UpperTorso or LowerTorso if you're using r15
ff.Visible = false

Each time the character spawns/respawns this code will run as the script reloads with the character.

0
The problem is i am trying to execute this script after it's parent has transfered it to a player,which means i cannot put it inside StarterCharacterScripts Echtic 128 — 6y
0
So you're trying to put the script in the player? That makes no sense it would be better to do it my way.. frostysubatomiczero 51 — 6y
0
but i need to do it after a certain function of it's parent script is done Echtic 128 — 6y
0
You didn't give enough info in your question frostysubatomiczero 51 — 6y
View all comments (2 more)
0
There is a certain fruit which when eaten should give that force field to a player Echtic 128 — 6y
0
sounds like something he took from Roblox's catalog :P DeceptiveCaster 3761 — 6y
Ad

Answer this question